import os
import sys
import numpy as np
import pandas as pd
import requests
import json
import matplotlib.pyplot as plt
from datetime import datetime, timedelta
stock_symbol = 'GOOGL'
initial_capital = 0
# Specify the parameters for the trading strategy
fast_ma_min = 5
fast_ma_max = 20
slow_ma_min = 10
slow_ma_max = 50
ma_increment = 5
min_ma_gap = 5
model_start_date = datetime(2019, 1, 1)
print("Starting date for the model:", model_start_date)
stock_start_date = model_start_date - timedelta(days=int(slow_ma_max*1.5)) # Need more pricing data to calculate moving averages
model_end_date = datetime.now()
# model_end_date = datetime(2020, 6, 30)
print("Ending date for the model:", model_end_date)
Starting date for the model: 2019-01-01 00:00:00 Ending date for the model: 2020-07-01 22:47:37.039312
# Begin the timer for the script processing
startTimeScript = datetime.now()
# Set up the verbose flag to print detailed messages for debugging (setting True will activate!)
verbose = True
# Set up the sendNotification flag to send progress emails (setting True will send emails!)
notifyStatus = False
# Set up the parent directory location for loading the dotenv files
useColab = False
if useColab:
# Mount Google Drive locally for storing files
from dotenv import load_dotenv
from google.colab import drive
drive.mount('/content/gdrive')
gdrivePrefix = '/content/gdrive/My Drive/Colab_Downloads/'
env_path = '/content/gdrive/My Drive/Colab Notebooks/'
dotenv_path = env_path + "python_script.env"
load_dotenv(dotenv_path=dotenv_path)
# Set up the dotenv file for retrieving environment variables
useLocalPC = False
if useLocalPC:
from dotenv import load_dotenv
env_path = "/Users/david/PycharmProjects/"
dotenv_path = env_path + "python_script.env"
load_dotenv(dotenv_path=dotenv_path)
# Configure the plotting style
plt.style.use('seaborn')
# Set Pandas options
pd.set_option("display.max_rows", None)
pd.set_option("display.max_columns", None)
# pd.set_option("display.width", 140)
# Check and see whether the API key is available
quandl_key = os.environ.get('QUANDL_API')
if quandl_key is None: sys.exit("API key for Quandl not available. Script Processing Aborted!!!")
start_date_string = stock_start_date.strftime('%Y-%m-%d')
end_date_string = model_end_date.strftime('%Y-%m-%d')
quandl_url = "https://www.quandl.com/api/v3/datatables/SHARADAR/SEP.json?date.gte=%s&date.lte=%s&ticker=%s&api_key=%s" % (start_date_string, end_date_string, stock_symbol, quandl_key)
response = requests.get(quandl_url)
quandl_dict = json.loads(response.text)
stock_quandl = pd.DataFrame(quandl_dict['datatable']['data'])
print(len(stock_quandl), 'data points retrieved from the API call.')
428 data points retrieved from the API call.
stock_quandl.columns = ['ticker', 'date', 'open', 'high', 'low', 'close', 'volume', 'dividend', 'closeunadj', 'lastupdated']
# stock_quandl.set_index('date', inplace=True)
stock_quandl.index = pd.to_datetime(stock_quandl.date)
stock_quandl = stock_quandl.sort_index(ascending = True)
stock_quandl.info(verbose=True)
<class 'pandas.core.frame.DataFrame'> DatetimeIndex: 428 entries, 2018-10-18 to 2020-07-01 Data columns (total 10 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 ticker 428 non-null object 1 date 428 non-null object 2 open 428 non-null float64 3 high 428 non-null float64 4 low 428 non-null float64 5 close 428 non-null float64 6 volume 428 non-null float64 7 dividend 428 non-null float64 8 closeunadj 428 non-null float64 9 lastupdated 428 non-null object dtypes: float64(7), object(3) memory usage: 36.8+ KB
stock_quandl.head()
| ticker | date | open | high | low | close | volume | dividend | closeunadj | lastupdated | |
|---|---|---|---|---|---|---|---|---|---|---|
| date | ||||||||||
| 2018-10-18 | GOOGL | 2018-10-18 | 1130.00 | 1132.35 | 1086.34 | 1097.91 | 2307596.0 | 0.0 | 1097.91 | 2020-05-01 |
| 2018-10-19 | GOOGL | 2018-10-19 | 1103.71 | 1120.95 | 1097.03 | 1105.18 | 2064289.0 | 0.0 | 1105.18 | 2020-05-01 |
| 2018-10-22 | GOOGL | 2018-10-22 | 1112.51 | 1121.69 | 1100.00 | 1111.37 | 1355842.0 | 0.0 | 1111.37 | 2020-05-01 |
| 2018-10-23 | GOOGL | 2018-10-23 | 1091.29 | 1118.00 | 1079.01 | 1114.91 | 1884255.0 | 0.0 | 1114.91 | 2020-05-01 |
| 2018-10-24 | GOOGL | 2018-10-24 | 1115.00 | 1116.62 | 1055.06 | 1057.12 | 2464295.0 | 0.0 | 1057.12 | 2020-05-01 |
stock_quandl.tail()
| ticker | date | open | high | low | close | volume | dividend | closeunadj | lastupdated | |
|---|---|---|---|---|---|---|---|---|---|---|
| date | ||||||||||
| 2020-06-25 | GOOGL | 2020-06-25 | 1431.22 | 1442.32 | 1419.54 | 1441.10 | 1194083.0 | 0.0 | 1441.10 | 2020-06-25 |
| 2020-06-26 | GOOGL | 2020-06-26 | 1432.63 | 1437.02 | 1355.00 | 1362.54 | 4882014.0 | 0.0 | 1362.54 | 2020-06-26 |
| 2020-06-29 | GOOGL | 2020-06-29 | 1360.34 | 1398.00 | 1351.65 | 1397.17 | 2246904.0 | 0.0 | 1397.17 | 2020-06-30 |
| 2020-06-30 | GOOGL | 2020-06-30 | 1396.88 | 1424.00 | 1386.93 | 1418.05 | 2007224.0 | 0.0 | 1418.05 | 2020-06-30 |
| 2020-07-01 | GOOGL | 2020-07-01 | 1419.17 | 1448.48 | 1414.18 | 1442.00 | 2071186.0 | 0.0 | 1442.00 | 2020-07-01 |
title_string = 'Quandl Historical Stock Information for ' + stock_symbol
stock_quandl['close'].plot(figsize=(16,9), title=title_string)
plt.show()
# Set up the standard column name for modeling
model_template = stock_quandl.loc[:, ['open','close']]
model_template.rename(columns={'open': 'open_price', 'close': 'close_price'}, inplace=True)
if verbose: model_template.info(verbose=True)
<class 'pandas.core.frame.DataFrame'> DatetimeIndex: 428 entries, 2018-10-18 to 2020-07-01 Data columns (total 2 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 open_price 428 non-null float64 1 close_price 428 non-null float64 dtypes: float64(2) memory usage: 10.0 KB
def trading_ma_crossover(model):
waitfor_first_entry = True
for x in range(len(model)):
if model['ma_change'].iloc[x] > 0:
model['trade_signal'].iloc[x] = 1 # trade_signal = 1 means we should take a long position
else:
model['trade_signal'].iloc[x] = 0 # trade_signal = 0 means we should take a flat position
if x != 0:
model['signal_change'].iloc[x] = model['trade_signal'].iloc[x] - model['trade_signal'].iloc[x-1]
if waitfor_first_entry and (model['signal_change'].iloc[x-1] == 1):
model['entry_exit'].iloc[x] = model['signal_change'].iloc[x-1]
waitfor_first_entry = False
elif (not waitfor_first_entry) and (model['signal_change'].iloc[x-1] != 0):
model['entry_exit'].iloc[x] = model['signal_change'].iloc[x-1]
model_collection = {}
serial_number = 1
for slow_ma in range(slow_ma_min, slow_ma_max+1, ma_increment):
for fast_ma in range(fast_ma_min, fast_ma_max+1, ma_increment):
if (slow_ma - fast_ma) < min_ma_gap: break
print('Processing model with slow_ma of', slow_ma, 'and fast_ma of', fast_ma)
model_name = 'SMA_' + str(serial_number).zfill(3) + '_SlowMA_' + str(slow_ma).zfill(2) + '_FastMA_' + str(fast_ma).zfill(2)
serial_number = serial_number + 1
trading_model = model_template.copy()
trading_model['fast_ma'] = trading_model['close_price'].rolling(fast_ma).mean()
trading_model['slow_ma'] = trading_model['close_price'].rolling(slow_ma).mean()
trading_model['ma_change'] = trading_model['fast_ma'] - trading_model['slow_ma']
trading_model['trade_signal'] = np.zeros(len(trading_model))
trading_model['signal_change'] = np.zeros(len(trading_model))
trading_model['entry_exit'] = np.zeros(len(trading_model))
trading_model = trading_model[model_start_date:model_end_date]
trading_ma_crossover(trading_model)
model_collection[model_name] = trading_model.copy()
print('Model', model_name, 'added to the trading model collection.')
Processing model with slow_ma of 10 and fast_ma of 5 Model SMA_001_SlowMA_10_FastMA_05 added to the trading model collection. Processing model with slow_ma of 15 and fast_ma of 5 Model SMA_002_SlowMA_15_FastMA_05 added to the trading model collection. Processing model with slow_ma of 15 and fast_ma of 10 Model SMA_003_SlowMA_15_FastMA_10 added to the trading model collection. Processing model with slow_ma of 20 and fast_ma of 5 Model SMA_004_SlowMA_20_FastMA_05 added to the trading model collection. Processing model with slow_ma of 20 and fast_ma of 10 Model SMA_005_SlowMA_20_FastMA_10 added to the trading model collection. Processing model with slow_ma of 20 and fast_ma of 15 Model SMA_006_SlowMA_20_FastMA_15 added to the trading model collection. Processing model with slow_ma of 25 and fast_ma of 5 Model SMA_007_SlowMA_25_FastMA_05 added to the trading model collection. Processing model with slow_ma of 25 and fast_ma of 10 Model SMA_008_SlowMA_25_FastMA_10 added to the trading model collection. Processing model with slow_ma of 25 and fast_ma of 15 Model SMA_009_SlowMA_25_FastMA_15 added to the trading model collection. Processing model with slow_ma of 25 and fast_ma of 20 Model SMA_010_SlowMA_25_FastMA_20 added to the trading model collection. Processing model with slow_ma of 30 and fast_ma of 5 Model SMA_011_SlowMA_30_FastMA_05 added to the trading model collection. Processing model with slow_ma of 30 and fast_ma of 10 Model SMA_012_SlowMA_30_FastMA_10 added to the trading model collection. Processing model with slow_ma of 30 and fast_ma of 15 Model SMA_013_SlowMA_30_FastMA_15 added to the trading model collection. Processing model with slow_ma of 30 and fast_ma of 20 Model SMA_014_SlowMA_30_FastMA_20 added to the trading model collection. Processing model with slow_ma of 35 and fast_ma of 5 Model SMA_015_SlowMA_35_FastMA_05 added to the trading model collection. Processing model with slow_ma of 35 and fast_ma of 10 Model SMA_016_SlowMA_35_FastMA_10 added to the trading model collection. Processing model with slow_ma of 35 and fast_ma of 15 Model SMA_017_SlowMA_35_FastMA_15 added to the trading model collection. Processing model with slow_ma of 35 and fast_ma of 20 Model SMA_018_SlowMA_35_FastMA_20 added to the trading model collection. Processing model with slow_ma of 40 and fast_ma of 5 Model SMA_019_SlowMA_40_FastMA_05 added to the trading model collection. Processing model with slow_ma of 40 and fast_ma of 10 Model SMA_020_SlowMA_40_FastMA_10 added to the trading model collection. Processing model with slow_ma of 40 and fast_ma of 15 Model SMA_021_SlowMA_40_FastMA_15 added to the trading model collection. Processing model with slow_ma of 40 and fast_ma of 20 Model SMA_022_SlowMA_40_FastMA_20 added to the trading model collection. Processing model with slow_ma of 45 and fast_ma of 5 Model SMA_023_SlowMA_45_FastMA_05 added to the trading model collection. Processing model with slow_ma of 45 and fast_ma of 10 Model SMA_024_SlowMA_45_FastMA_10 added to the trading model collection. Processing model with slow_ma of 45 and fast_ma of 15 Model SMA_025_SlowMA_45_FastMA_15 added to the trading model collection. Processing model with slow_ma of 45 and fast_ma of 20 Model SMA_026_SlowMA_45_FastMA_20 added to the trading model collection. Processing model with slow_ma of 50 and fast_ma of 5 Model SMA_027_SlowMA_50_FastMA_05 added to the trading model collection. Processing model with slow_ma of 50 and fast_ma of 10 Model SMA_028_SlowMA_50_FastMA_10 added to the trading model collection. Processing model with slow_ma of 50 and fast_ma of 15 Model SMA_029_SlowMA_50_FastMA_15 added to the trading model collection. Processing model with slow_ma of 50 and fast_ma of 20 Model SMA_030_SlowMA_50_FastMA_20 added to the trading model collection.
# List the entry/exit points for each model
for key in model_collection:
print('List the signal change and entry/exit points for', key)
if verbose: print(model_collection[key][(model_collection[key].signal_change != 0) | (model_collection[key].entry_exit != 0)])
else: print(model_collection[key][model_collection[key].entry_exit != 0])
print()
List the signal change and entry/exit points for SMA_001_SlowMA_10_FastMA_05
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-17 1087.99 1099.12 1078.224 1079.096 -0.872
2019-01-18 1108.59 1107.30 1086.790 1082.019 4.771
2019-01-22 1096.00 1078.63 1092.214 1082.290 9.924
2019-01-28 1090.07 1079.86 1085.682 1086.236 -0.554
2019-01-29 1081.04 1070.06 1083.968 1088.091 -4.123
2019-01-31 1112.24 1125.89 1095.062 1092.877 2.185
2019-02-01 1122.29 1118.62 1098.484 1094.827 3.657
2019-02-12 1111.01 1127.58 1112.176 1119.667 -7.491
2019-02-13 1133.04 1128.63 1113.324 1122.731 -9.407
2019-02-19 1116.64 1126.51 1126.310 1121.672 4.638
2019-02-20 1128.88 1120.59 1124.912 1118.544 6.368
2019-02-22 1109.70 1116.56 1117.500 1117.741 -0.241
2019-02-25 1121.93 1117.33 1117.040 1119.236 -2.196
2019-02-28 1119.00 1126.55 1121.068 1120.548 0.520
2019-03-01 1131.00 1148.52 1127.460 1122.480 4.980
2019-03-28 1175.50 1172.27 1189.030 1198.902 -9.872
2019-03-29 1180.18 1176.89 1182.878 1197.561 -14.683
2019-04-04 1211.29 1219.45 1202.334 1195.682 6.652
2019-04-05 1219.30 1211.45 1209.246 1196.062 13.184
2019-05-01 1197.50 1173.32 1242.648 1247.925 -5.277
2019-05-02 1172.60 1166.51 1222.482 1240.562 -18.080
2019-05-21 1154.48 1154.44 1164.636 1159.102 5.534
2019-05-22 1151.25 1155.85 1161.646 1157.609 4.037
2019-05-23 1146.07 1145.34 1153.814 1155.346 -1.532
2019-05-24 1152.00 1138.61 1147.780 1152.443 -4.663
2019-06-13 1084.71 1091.01 1080.456 1069.441 11.015
2019-06-14 1089.74 1086.30 1084.042 1067.421 16.621
2019-06-27 1086.75 1076.63 1097.320 1098.974 -1.654
2019-06-28 1077.23 1082.80 1088.806 1098.624 -9.818
2019-07-05 1119.37 1132.66 1110.210 1103.765 6.445
2019-07-08 1125.87 1116.79 1117.008 1102.907 14.101
2019-07-23 1143.45 1148.05 1142.558 1144.709 -2.151
2019-07-24 1132.62 1139.73 1141.156 1144.591 -3.435
2019-07-26 1228.00 1245.22 1161.630 1153.765 7.865
2019-07-29 1242.50 1241.84 1182.156 1162.898 19.258
2019-08-06 1165.52 1171.08 1190.426 1194.286 -3.860
2019-08-07 1157.80 1175.91 1181.968 1197.904 -15.936
2019-08-14 1176.07 1164.25 1186.114 1184.041 2.073
2019-08-15 1168.43 1169.32 1178.740 1179.795 -1.055
2019-08-16 1180.79 1179.21 1176.802 1178.084 -1.282
2019-08-22 1193.80 1191.52 1189.256 1183.998 5.258
2019-08-23 1185.17 1153.58 1184.130 1180.466 3.664
2019-08-26 1159.45 1171.18 1178.278 1180.134 -1.856
2019-08-27 1183.00 1170.82 1175.736 1177.543 -1.807
2019-09-03 1181.85 1169.55 1179.778 1179.028 0.750
2019-09-04 1179.45 1182.27 1182.068 1178.902 3.166
2019-09-24 1240.00 1218.33 1230.852 1231.077 -0.225
2019-09-25 1216.01 1245.94 1233.510 1233.671 -0.161
2019-09-27 1242.83 1225.95 1233.440 1232.995 0.445
2019-09-30 1220.60 1221.14 1230.730 1231.946 -1.216
2019-10-01 1222.49 1206.00 1228.264 1229.558 -1.294
2019-10-10 1198.60 1209.47 1204.242 1204.165 0.077
2019-10-11 1224.03 1215.71 1205.192 1203.141 2.051
2019-11-22 1303.00 1293.67 1305.620 1306.246 -0.626
2019-11-25 1296.26 1305.64 1302.780 1306.982 -4.202
2019-12-04 1306.10 1318.94 1303.752 1303.307 0.445
2019-12-05 1327.00 1326.96 1306.718 1305.817 0.901
2019-12-24 1350.21 1344.43 1350.926 1350.983 -0.057
2019-12-26 1346.55 1362.47 1353.038 1352.805 0.233
2019-12-27 1364.00 1354.64 1352.678 1353.420 -0.742
2019-12-30 1356.81 1339.71 1350.376 1352.704 -2.328
2020-01-02 1348.41 1368.68 1352.978 1351.952 1.026
2020-01-03 1348.00 1361.52 1352.788 1352.913 -0.125
2020-01-06 1351.63 1397.81 1361.422 1357.050 4.372
2020-01-07 1400.46 1395.11 1372.502 1361.439 11.063
2020-01-29 1458.46 1456.70 1457.958 1462.509 -4.551
2020-01-30 1438.10 1454.25 1451.870 1464.014 -12.144
2020-02-06 1451.98 1475.97 1456.562 1454.216 2.346
2020-02-07 1467.38 1479.11 1465.828 1455.510 10.318
2020-02-24 1423.05 1419.86 1492.924 1503.409 -10.485
2020-02-25 1431.00 1386.32 1466.300 1491.175 -24.875
2020-03-27 1127.47 1110.26 1111.788 1102.107 9.681
2020-03-30 1132.64 1146.31 1130.224 1109.438 20.786
2020-04-07 1217.01 1182.56 1135.516 1136.064 -0.548
2020-04-08 1203.10 1207.00 1156.496 1146.602 9.894
2020-04-09 1218.18 1206.57 1174.404 1150.967 23.437
2020-04-27 1292.00 1270.86 1257.840 1260.931 -3.091
2020-04-28 1283.20 1232.59 1261.926 1257.667 4.259
2020-04-29 1345.00 1342.18 1278.680 1266.155 12.525
2020-05-18 1361.58 1385.18 1367.722 1369.027 -1.305
2020-05-19 1385.48 1374.40 1367.566 1371.565 -3.999
2020-05-20 1389.16 1409.16 1379.732 1377.938 1.794
2020-05-21 1410.99 1406.75 1389.710 1381.685 8.025
2020-06-15 1389.49 1420.74 1430.468 1433.626 -3.158
2020-06-16 1449.00 1446.47 1429.346 1434.042 -4.696
2020-06-22 1425.01 1450.66 1441.686 1436.077 5.609
2020-06-23 1452.00 1463.98 1445.188 1437.267 7.921
2020-06-26 1432.63 1362.54 1430.196 1432.949 -2.753
2020-06-29 1360.34 1397.17 1419.498 1430.592 -11.094
trade_signal signal_change entry_exit
date
2019-01-17 0.0 -1.0 0.0
2019-01-18 1.0 1.0 0.0
2019-01-22 1.0 0.0 1.0
2019-01-28 0.0 -1.0 0.0
2019-01-29 0.0 0.0 -1.0
2019-01-31 1.0 1.0 0.0
2019-02-01 1.0 0.0 1.0
2019-02-12 0.0 -1.0 0.0
2019-02-13 0.0 0.0 -1.0
2019-02-19 1.0 1.0 0.0
2019-02-20 1.0 0.0 1.0
2019-02-22 0.0 -1.0 0.0
2019-02-25 0.0 0.0 -1.0
2019-02-28 1.0 1.0 0.0
2019-03-01 1.0 0.0 1.0
2019-03-28 0.0 -1.0 0.0
2019-03-29 0.0 0.0 -1.0
2019-04-04 1.0 1.0 0.0
2019-04-05 1.0 0.0 1.0
2019-05-01 0.0 -1.0 0.0
2019-05-02 0.0 0.0 -1.0
2019-05-21 1.0 1.0 0.0
2019-05-22 1.0 0.0 1.0
2019-05-23 0.0 -1.0 0.0
2019-05-24 0.0 0.0 -1.0
2019-06-13 1.0 1.0 0.0
2019-06-14 1.0 0.0 1.0
2019-06-27 0.0 -1.0 0.0
2019-06-28 0.0 0.0 -1.0
2019-07-05 1.0 1.0 0.0
2019-07-08 1.0 0.0 1.0
2019-07-23 0.0 -1.0 0.0
2019-07-24 0.0 0.0 -1.0
2019-07-26 1.0 1.0 0.0
2019-07-29 1.0 0.0 1.0
2019-08-06 0.0 -1.0 0.0
2019-08-07 0.0 0.0 -1.0
2019-08-14 1.0 1.0 0.0
2019-08-15 0.0 -1.0 1.0
2019-08-16 0.0 0.0 -1.0
2019-08-22 1.0 1.0 0.0
2019-08-23 1.0 0.0 1.0
2019-08-26 0.0 -1.0 0.0
2019-08-27 0.0 0.0 -1.0
2019-09-03 1.0 1.0 0.0
2019-09-04 1.0 0.0 1.0
2019-09-24 0.0 -1.0 0.0
2019-09-25 0.0 0.0 -1.0
2019-09-27 1.0 1.0 0.0
2019-09-30 0.0 -1.0 1.0
2019-10-01 0.0 0.0 -1.0
2019-10-10 1.0 1.0 0.0
2019-10-11 1.0 0.0 1.0
2019-11-22 0.0 -1.0 0.0
2019-11-25 0.0 0.0 -1.0
2019-12-04 1.0 1.0 0.0
2019-12-05 1.0 0.0 1.0
2019-12-24 0.0 -1.0 0.0
2019-12-26 1.0 1.0 -1.0
2019-12-27 0.0 -1.0 1.0
2019-12-30 0.0 0.0 -1.0
2020-01-02 1.0 1.0 0.0
2020-01-03 0.0 -1.0 1.0
2020-01-06 1.0 1.0 -1.0
2020-01-07 1.0 0.0 1.0
2020-01-29 0.0 -1.0 0.0
2020-01-30 0.0 0.0 -1.0
2020-02-06 1.0 1.0 0.0
2020-02-07 1.0 0.0 1.0
2020-02-24 0.0 -1.0 0.0
2020-02-25 0.0 0.0 -1.0
2020-03-27 1.0 1.0 0.0
2020-03-30 1.0 0.0 1.0
2020-04-07 0.0 -1.0 0.0
2020-04-08 1.0 1.0 -1.0
2020-04-09 1.0 0.0 1.0
2020-04-27 0.0 -1.0 0.0
2020-04-28 1.0 1.0 -1.0
2020-04-29 1.0 0.0 1.0
2020-05-18 0.0 -1.0 0.0
2020-05-19 0.0 0.0 -1.0
2020-05-20 1.0 1.0 0.0
2020-05-21 1.0 0.0 1.0
2020-06-15 0.0 -1.0 0.0
2020-06-16 0.0 0.0 -1.0
2020-06-22 1.0 1.0 0.0
2020-06-23 1.0 0.0 1.0
2020-06-26 0.0 -1.0 0.0
2020-06-29 0.0 0.0 -1.0
List the signal change and entry/exit points for SMA_002_SlowMA_15_FastMA_05
open_price close_price fast_ma slow_ma ma_change \
date
2019-02-21 1118.78 1104.21 1120.028 1121.830000 -1.802000
2019-02-28 1119.00 1126.55 1121.068 1118.140000 2.928000
2019-03-01 1131.00 1148.52 1127.460 1120.980667 6.479333
2019-03-28 1175.50 1172.27 1189.030 1193.806000 -4.776000
2019-03-29 1180.18 1176.89 1182.878 1195.600667 -12.722667
2019-04-04 1211.29 1219.45 1202.334 1200.046000 2.288000
2019-04-05 1219.30 1211.45 1209.246 1201.456000 7.790000
2019-05-02 1172.60 1166.51 1222.482 1235.768000 -13.286000
2019-05-03 1177.41 1189.55 1204.908 1234.432000 -29.524000
2019-06-17 1089.10 1093.89 1086.268 1083.700667 2.567333
2019-06-18 1111.50 1105.24 1091.108 1081.412667 9.695333
2019-06-28 1077.23 1082.80 1088.806 1093.763333 -4.957333
2019-07-01 1101.04 1100.00 1085.466 1094.912667 -9.446667
2019-07-05 1119.37 1132.66 1110.210 1102.719333 7.490667
2019-07-08 1125.87 1116.79 1117.008 1104.752000 12.256000
2019-07-25 1138.95 1135.94 1138.896 1139.766667 -0.870667
2019-07-26 1228.00 1245.22 1161.630 1147.270667 14.359333
2019-07-29 1242.50 1241.84 1182.156 1155.607333 26.548667
2019-08-08 1186.43 1206.19 1180.850 1182.918000 -2.068000
2019-08-09 1199.99 1188.90 1179.366 1186.741333 -7.375333
2019-08-21 1195.82 1191.58 1184.816 1184.299333 0.516667
2019-08-22 1193.80 1191.52 1189.256 1182.948667 6.307333
2019-08-26 1159.45 1171.18 1178.278 1181.194667 -2.916667
2019-08-27 1183.00 1170.82 1175.736 1181.177333 -5.441333
2019-09-04 1179.45 1182.27 1182.068 1179.051333 3.016667
2019-09-05 1193.66 1212.19 1189.756 1182.247333 7.508667
2019-10-01 1222.49 1206.00 1228.264 1230.139333 -1.875333
2019-10-02 1196.50 1177.92 1214.660 1227.334000 -12.674000
2019-10-15 1221.50 1242.24 1217.518 1213.706667 3.811333
2019-10-16 1241.81 1243.00 1225.638 1213.510667 12.127333
2019-11-25 1296.26 1305.64 1302.780 1304.432667 -1.652667
2019-11-26 1309.91 1313.00 1302.862 1305.870000 -3.008000
2019-12-06 1332.75 1339.39 1313.778 1311.026000 2.752000
2019-12-09 1338.86 1342.99 1324.604 1311.656000 12.948000
2019-12-31 1335.79 1339.39 1348.128 1349.928667 -1.800667
2020-01-02 1348.41 1368.68 1352.978 1351.648000 1.330000
2020-01-03 1348.00 1361.52 1352.788 1352.799333 -0.011333
2020-01-06 1351.63 1397.81 1361.422 1356.087333 5.334667
2020-01-07 1400.46 1395.11 1372.502 1359.303333 13.198667
2020-01-30 1438.10 1454.25 1451.870 1453.247333 -1.377333
2020-01-31 1467.86 1432.78 1445.192 1454.113333 -8.921333
2020-02-07 1467.38 1479.11 1465.828 1463.460000 2.368000
2020-02-10 1477.23 1508.66 1471.040 1465.402667 5.637333
2020-02-25 1431.00 1386.32 1466.300 1484.463333 -18.163333
2020-02-26 1394.98 1390.47 1439.420 1480.800667 -41.380667
2020-03-31 1148.73 1161.95 1136.612 1124.403333 12.208667
2020-04-01 1124.00 1102.10 1136.708 1117.150000 19.558000
2020-06-15 1389.49 1420.74 1430.468 1430.969333 -0.501333
2020-06-16 1449.00 1446.47 1429.346 1432.642667 -3.296667
2020-06-19 1440.00 1424.64 1435.702 1435.260000 0.442000
2020-06-22 1425.01 1450.66 1441.686 1436.312667 5.373333
2020-06-26 1432.63 1362.54 1430.196 1433.942000 -3.746000
2020-06-29 1360.34 1397.17 1419.498 1430.550667 -11.052667
trade_signal signal_change entry_exit
date
2019-02-21 0.0 -1.0 0.0
2019-02-28 1.0 1.0 0.0
2019-03-01 1.0 0.0 1.0
2019-03-28 0.0 -1.0 0.0
2019-03-29 0.0 0.0 -1.0
2019-04-04 1.0 1.0 0.0
2019-04-05 1.0 0.0 1.0
2019-05-02 0.0 -1.0 0.0
2019-05-03 0.0 0.0 -1.0
2019-06-17 1.0 1.0 0.0
2019-06-18 1.0 0.0 1.0
2019-06-28 0.0 -1.0 0.0
2019-07-01 0.0 0.0 -1.0
2019-07-05 1.0 1.0 0.0
2019-07-08 1.0 0.0 1.0
2019-07-25 0.0 -1.0 0.0
2019-07-26 1.0 1.0 -1.0
2019-07-29 1.0 0.0 1.0
2019-08-08 0.0 -1.0 0.0
2019-08-09 0.0 0.0 -1.0
2019-08-21 1.0 1.0 0.0
2019-08-22 1.0 0.0 1.0
2019-08-26 0.0 -1.0 0.0
2019-08-27 0.0 0.0 -1.0
2019-09-04 1.0 1.0 0.0
2019-09-05 1.0 0.0 1.0
2019-10-01 0.0 -1.0 0.0
2019-10-02 0.0 0.0 -1.0
2019-10-15 1.0 1.0 0.0
2019-10-16 1.0 0.0 1.0
2019-11-25 0.0 -1.0 0.0
2019-11-26 0.0 0.0 -1.0
2019-12-06 1.0 1.0 0.0
2019-12-09 1.0 0.0 1.0
2019-12-31 0.0 -1.0 0.0
2020-01-02 1.0 1.0 -1.0
2020-01-03 0.0 -1.0 1.0
2020-01-06 1.0 1.0 -1.0
2020-01-07 1.0 0.0 1.0
2020-01-30 0.0 -1.0 0.0
2020-01-31 0.0 0.0 -1.0
2020-02-07 1.0 1.0 0.0
2020-02-10 1.0 0.0 1.0
2020-02-25 0.0 -1.0 0.0
2020-02-26 0.0 0.0 -1.0
2020-03-31 1.0 1.0 0.0
2020-04-01 1.0 0.0 1.0
2020-06-15 0.0 -1.0 0.0
2020-06-16 0.0 0.0 -1.0
2020-06-19 1.0 1.0 0.0
2020-06-22 1.0 0.0 1.0
2020-06-26 0.0 -1.0 0.0
2020-06-29 0.0 0.0 -1.0
List the signal change and entry/exit points for SMA_003_SlowMA_15_FastMA_10
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-07 1080.97 1075.92 1040.245 1038.817333 1.427667
2019-01-08 1086.00 1085.37 1049.657 1041.061333 8.595667
2019-02-20 1128.88 1120.59 1118.544 1121.415333 -2.871333
2019-02-21 1118.78 1104.21 1116.676 1121.830000 -5.154000
2019-02-26 1114.37 1122.01 1121.225 1119.828000 1.397000
2019-02-27 1114.01 1122.89 1120.756 1117.896000 2.860000
2019-04-03 1212.70 1210.81 1197.350 1198.251333 -0.901333
2019-04-04 1211.29 1219.45 1195.682 1200.046000 -4.364000
2019-04-11 1208.90 1209.59 1205.013 1199.685333 5.327667
2019-04-12 1215.62 1222.73 1209.597 1200.690667 8.906333
2019-05-06 1172.00 1193.46 1229.340 1232.480667 -3.140667
2019-05-07 1185.81 1178.86 1220.167 1229.302667 -9.135667
2019-06-19 1107.24 1104.51 1083.998 1080.384000 3.614000
2019-06-20 1121.70 1113.20 1090.542 1079.836667 10.705333
2019-07-08 1125.87 1116.79 1102.907 1104.752000 -1.845000
2019-07-09 1110.32 1124.29 1103.666 1106.778667 -3.112667
2019-07-11 1146.16 1144.08 1115.375 1111.794667 3.580333
2019-07-12 1142.93 1145.34 1122.246 1113.937333 8.308667
2019-08-13 1174.35 1196.73 1189.436 1192.339333 -2.903333
2019-08-14 1176.07 1164.25 1184.041 1193.974000 -9.933000
2019-08-21 1195.82 1191.58 1185.465 1184.299333 1.165667
2019-08-22 1193.80 1191.52 1183.998 1182.948667 1.049333
2019-08-26 1159.45 1171.18 1180.134 1181.194667 -1.060667
2019-08-27 1183.00 1170.82 1177.543 1181.177333 -3.634333
2019-08-29 1186.42 1194.24 1180.985 1180.236667 0.748333
2019-08-30 1200.35 1190.53 1182.117 1180.345333 1.771667
2019-09-03 1181.85 1169.55 1179.028 1180.015333 -0.987333
2019-09-04 1179.45 1182.27 1178.902 1179.051333 -0.149333
2019-09-09 1207.08 1205.27 1187.612 1186.451333 1.160667
2019-09-10 1196.09 1205.70 1191.064 1186.802000 4.262000
2019-10-01 1222.49 1206.00 1229.558 1230.139333 -0.581333
2019-10-02 1196.50 1177.92 1224.085 1227.334000 -3.249000
2019-10-17 1251.40 1252.80 1219.273 1214.211333 5.061667
2019-10-18 1254.69 1244.41 1222.618 1215.442000 7.176000
2019-12-02 1302.56 1288.86 1305.182 1305.745333 -0.563333
2019-12-03 1278.66 1294.74 1302.672 1305.509333 -2.837333
2019-12-09 1338.86 1342.99 1314.674 1311.656000 3.018000
2019-12-10 1339.94 1342.89 1318.399 1313.192667 5.206333
2020-02-05 1463.61 1446.05 1455.088 1459.078667 -3.990667
2020-02-06 1451.98 1475.97 1454.216 1461.530000 -7.314000
2020-02-11 1513.27 1510.06 1469.159 1467.256667 1.902333
2020-02-12 1515.86 1518.63 1475.352 1469.554000 5.798000
2020-02-26 1394.98 1390.47 1479.216 1480.800667 -1.584667
2020-02-27 1359.14 1314.95 1458.848 1472.060667 -13.212667
2020-04-03 1114.71 1092.70 1117.903 1109.410667 8.492333
2020-04-06 1133.00 1183.19 1130.809 1116.756667 14.052333
2020-06-22 1425.01 1450.66 1436.077 1436.312667 -0.235667
2020-06-23 1452.00 1463.98 1437.267 1437.757333 -0.490333
2020-06-29 1360.34 1397.17 1430.592 1430.550667 0.041333
2020-06-30 1396.88 1418.05 1427.750 1428.282000 -0.532000
2020-07-01 1419.17 1442.00 1426.696 1426.768667 -0.072667
trade_signal signal_change entry_exit
date
2019-01-07 1.0 1.0 0.0
2019-01-08 1.0 0.0 1.0
2019-02-20 0.0 -1.0 0.0
2019-02-21 0.0 0.0 -1.0
2019-02-26 1.0 1.0 0.0
2019-02-27 1.0 0.0 1.0
2019-04-03 0.0 -1.0 0.0
2019-04-04 0.0 0.0 -1.0
2019-04-11 1.0 1.0 0.0
2019-04-12 1.0 0.0 1.0
2019-05-06 0.0 -1.0 0.0
2019-05-07 0.0 0.0 -1.0
2019-06-19 1.0 1.0 0.0
2019-06-20 1.0 0.0 1.0
2019-07-08 0.0 -1.0 0.0
2019-07-09 0.0 0.0 -1.0
2019-07-11 1.0 1.0 0.0
2019-07-12 1.0 0.0 1.0
2019-08-13 0.0 -1.0 0.0
2019-08-14 0.0 0.0 -1.0
2019-08-21 1.0 1.0 0.0
2019-08-22 1.0 0.0 1.0
2019-08-26 0.0 -1.0 0.0
2019-08-27 0.0 0.0 -1.0
2019-08-29 1.0 1.0 0.0
2019-08-30 1.0 0.0 1.0
2019-09-03 0.0 -1.0 0.0
2019-09-04 0.0 0.0 -1.0
2019-09-09 1.0 1.0 0.0
2019-09-10 1.0 0.0 1.0
2019-10-01 0.0 -1.0 0.0
2019-10-02 0.0 0.0 -1.0
2019-10-17 1.0 1.0 0.0
2019-10-18 1.0 0.0 1.0
2019-12-02 0.0 -1.0 0.0
2019-12-03 0.0 0.0 -1.0
2019-12-09 1.0 1.0 0.0
2019-12-10 1.0 0.0 1.0
2020-02-05 0.0 -1.0 0.0
2020-02-06 0.0 0.0 -1.0
2020-02-11 1.0 1.0 0.0
2020-02-12 1.0 0.0 1.0
2020-02-26 0.0 -1.0 0.0
2020-02-27 0.0 0.0 -1.0
2020-04-03 1.0 1.0 0.0
2020-04-06 1.0 0.0 1.0
2020-06-22 0.0 -1.0 0.0
2020-06-23 0.0 0.0 -1.0
2020-06-29 1.0 1.0 0.0
2020-06-30 0.0 -1.0 1.0
2020-07-01 0.0 0.0 -1.0
List the signal change and entry/exit points for SMA_004_SlowMA_20_FastMA_05
open_price close_price fast_ma slow_ma ma_change \
date
2019-02-26 1114.37 1122.01 1116.140 1117.5700 -1.4300
2019-03-01 1131.00 1148.52 1127.460 1122.7710 4.6890
2019-03-04 1154.56 1153.42 1134.678 1124.5110 10.1670
2019-03-29 1180.18 1176.89 1182.878 1186.1190 -3.2410
2019-04-01 1187.54 1198.98 1183.198 1188.3970 -5.1990
2019-04-03 1212.70 1210.81 1192.898 1192.5080 0.3900
2019-04-04 1211.29 1219.45 1202.334 1195.9380 6.3960
2019-05-02 1172.60 1166.51 1222.482 1229.2420 -6.7600
2019-05-03 1177.41 1189.55 1204.908 1227.7470 -22.8390
2019-06-19 1107.24 1104.51 1096.190 1095.2530 0.9370
2019-06-20 1121.70 1113.20 1100.628 1093.1205 7.5075
2019-07-01 1101.04 1100.00 1085.466 1086.0855 -0.6195
2019-07-02 1104.83 1112.60 1090.470 1088.9910 1.4790
2019-07-03 1118.50 1122.99 1099.004 1092.9085 6.0955
2019-08-15 1168.43 1169.32 1178.740 1181.8735 -3.1335
2019-08-16 1180.79 1179.21 1176.802 1184.2565 -7.4545
2019-08-30 1200.35 1190.53 1180.104 1180.1005 0.0035
2019-09-03 1181.85 1169.55 1179.778 1180.8405 -1.0625
2019-09-04 1179.45 1182.27 1182.068 1181.4000 0.6680
2019-09-05 1193.66 1212.19 1189.756 1183.2140 6.5420
2019-10-02 1196.50 1177.92 1214.660 1222.9745 -8.3145
2019-10-03 1183.34 1189.43 1204.088 1221.8365 -17.7485
2019-10-16 1241.81 1243.00 1225.638 1218.5105 7.1275
2019-10-17 1251.40 1252.80 1234.304 1219.2130 15.0910
2019-12-03 1278.66 1294.74 1302.564 1303.9655 -1.4015
2019-12-04 1306.10 1318.94 1303.752 1305.3405 -1.5885
2019-12-06 1332.75 1339.39 1313.778 1308.7605 5.0175
2019-12-09 1338.86 1342.99 1324.604 1310.4600 14.1440
2020-02-25 1431.00 1386.32 1466.300 1477.1890 -10.8890
2020-02-26 1394.98 1390.47 1439.420 1474.1875 -34.7675
2020-04-07 1217.01 1182.56 1135.516 1127.1815 8.3345
2020-04-08 1203.10 1207.00 1156.496 1126.9865 29.5095
2020-06-17 1452.94 1452.54 1426.914 1429.6350 -2.7210
2020-06-18 1449.85 1434.12 1433.358 1430.8830 2.4750
2020-06-19 1440.00 1424.64 1435.702 1431.7775 3.9245
2020-06-26 1432.63 1362.54 1430.196 1433.9940 -3.7980
2020-06-29 1360.34 1397.17 1419.498 1432.1090 -12.6110
trade_signal signal_change entry_exit
date
2019-02-26 0.0 -1.0 0.0
2019-03-01 1.0 1.0 0.0
2019-03-04 1.0 0.0 1.0
2019-03-29 0.0 -1.0 0.0
2019-04-01 0.0 0.0 -1.0
2019-04-03 1.0 1.0 0.0
2019-04-04 1.0 0.0 1.0
2019-05-02 0.0 -1.0 0.0
2019-05-03 0.0 0.0 -1.0
2019-06-19 1.0 1.0 0.0
2019-06-20 1.0 0.0 1.0
2019-07-01 0.0 -1.0 0.0
2019-07-02 1.0 1.0 -1.0
2019-07-03 1.0 0.0 1.0
2019-08-15 0.0 -1.0 0.0
2019-08-16 0.0 0.0 -1.0
2019-08-30 1.0 1.0 0.0
2019-09-03 0.0 -1.0 1.0
2019-09-04 1.0 1.0 -1.0
2019-09-05 1.0 0.0 1.0
2019-10-02 0.0 -1.0 0.0
2019-10-03 0.0 0.0 -1.0
2019-10-16 1.0 1.0 0.0
2019-10-17 1.0 0.0 1.0
2019-12-03 0.0 -1.0 0.0
2019-12-04 0.0 0.0 -1.0
2019-12-06 1.0 1.0 0.0
2019-12-09 1.0 0.0 1.0
2020-02-25 0.0 -1.0 0.0
2020-02-26 0.0 0.0 -1.0
2020-04-07 1.0 1.0 0.0
2020-04-08 1.0 0.0 1.0
2020-06-17 0.0 -1.0 0.0
2020-06-18 1.0 1.0 -1.0
2020-06-19 1.0 0.0 1.0
2020-06-26 0.0 -1.0 0.0
2020-06-29 0.0 0.0 -1.0
List the signal change and entry/exit points for SMA_005_SlowMA_20_FastMA_10
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-08 1086.00 1085.37 1049.657 1046.4865 3.1705
2019-01-09 1087.99 1081.65 1059.355 1047.9100 11.4450
2019-02-28 1119.00 1126.55 1120.548 1121.6395 -1.0915
2019-03-01 1131.00 1148.52 1122.480 1122.7710 -0.2910
2019-03-04 1154.56 1153.42 1125.859 1124.5110 1.3480
2019-03-05 1156.00 1169.19 1130.127 1125.8995 4.2275
2019-04-04 1211.29 1219.45 1195.682 1195.9380 -0.2560
2019-04-05 1219.30 1211.45 1196.062 1199.0120 -2.9500
2019-04-10 1205.09 1206.45 1201.281 1201.1045 0.1765
2019-04-11 1208.90 1209.59 1205.013 1201.9575 3.0555
2019-05-07 1185.81 1178.86 1220.167 1225.3765 -5.2095
2019-05-08 1177.29 1170.78 1211.240 1223.7810 -12.5410
2019-06-21 1109.86 1125.37 1096.242 1092.1220 4.1200
2019-06-24 1120.00 1116.70 1099.636 1091.0265 8.6095
2019-08-15 1168.43 1169.32 1179.795 1181.8735 -2.0785
2019-08-16 1180.79 1179.21 1178.084 1184.2565 -6.1725
2019-08-29 1186.42 1194.24 1180.985 1180.3900 0.5950
2019-08-30 1200.35 1190.53 1182.117 1180.1005 2.0165
2019-09-03 1181.85 1169.55 1179.028 1180.8405 -1.8125
2019-09-04 1179.45 1182.27 1178.902 1181.4000 -2.4980
2019-09-09 1207.08 1205.27 1187.612 1184.0390 3.5730
2019-09-10 1196.09 1205.70 1191.064 1185.5990 5.4650
2019-10-03 1183.34 1189.43 1219.153 1221.8365 -2.6835
2019-10-04 1194.29 1210.96 1217.265 1222.0685 -4.8035
2019-10-17 1251.40 1252.80 1219.273 1219.2130 0.0600
2019-10-18 1254.69 1244.41 1222.618 1219.9415 2.6765
2019-12-03 1278.66 1294.74 1302.672 1303.9655 -1.2935
2019-12-04 1306.10 1318.94 1303.307 1305.3405 -2.0335
2019-12-06 1332.75 1339.39 1309.742 1308.7605 0.9815
2019-12-09 1338.86 1342.99 1314.674 1310.4600 4.2140
2020-02-07 1467.38 1479.11 1455.510 1457.0420 -1.5320
2020-02-10 1477.23 1508.66 1463.203 1461.0270 2.1760
2020-02-11 1513.27 1510.06 1469.159 1464.5285 4.6305
2020-02-27 1359.14 1314.95 1458.848 1467.1000 -8.2520
2020-02-28 1274.31 1339.25 1441.434 1461.3500 -19.9160
2020-04-07 1217.01 1182.56 1136.064 1127.1815 8.8825
2020-04-08 1203.10 1207.00 1146.602 1126.9865 19.6155
2020-06-24 1463.28 1432.70 1434.067 1436.4000 -2.3330
2020-06-25 1431.22 1441.10 1437.987 1437.5430 0.4440
2020-06-26 1432.63 1362.54 1432.949 1433.9940 -1.0450
2020-06-29 1360.34 1397.17 1430.592 1432.1090 -1.5170
trade_signal signal_change entry_exit
date
2019-01-08 1.0 1.0 0.0
2019-01-09 1.0 0.0 1.0
2019-02-28 0.0 -1.0 0.0
2019-03-01 0.0 0.0 -1.0
2019-03-04 1.0 1.0 0.0
2019-03-05 1.0 0.0 1.0
2019-04-04 0.0 -1.0 0.0
2019-04-05 0.0 0.0 -1.0
2019-04-10 1.0 1.0 0.0
2019-04-11 1.0 0.0 1.0
2019-05-07 0.0 -1.0 0.0
2019-05-08 0.0 0.0 -1.0
2019-06-21 1.0 1.0 0.0
2019-06-24 1.0 0.0 1.0
2019-08-15 0.0 -1.0 0.0
2019-08-16 0.0 0.0 -1.0
2019-08-29 1.0 1.0 0.0
2019-08-30 1.0 0.0 1.0
2019-09-03 0.0 -1.0 0.0
2019-09-04 0.0 0.0 -1.0
2019-09-09 1.0 1.0 0.0
2019-09-10 1.0 0.0 1.0
2019-10-03 0.0 -1.0 0.0
2019-10-04 0.0 0.0 -1.0
2019-10-17 1.0 1.0 0.0
2019-10-18 1.0 0.0 1.0
2019-12-03 0.0 -1.0 0.0
2019-12-04 0.0 0.0 -1.0
2019-12-06 1.0 1.0 0.0
2019-12-09 1.0 0.0 1.0
2020-02-07 0.0 -1.0 0.0
2020-02-10 1.0 1.0 -1.0
2020-02-11 1.0 0.0 1.0
2020-02-27 0.0 -1.0 0.0
2020-02-28 0.0 0.0 -1.0
2020-04-07 1.0 1.0 0.0
2020-04-08 1.0 0.0 1.0
2020-06-24 0.0 -1.0 0.0
2020-06-25 1.0 1.0 -1.0
2020-06-26 0.0 -1.0 1.0
2020-06-29 0.0 0.0 -1.0
List the signal change and entry/exit points for SMA_006_SlowMA_20_FastMA_15
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-11 1069.90 1064.47 1049.090000 1048.3060 0.784000
2019-01-14 1053.34 1051.51 1050.952000 1047.2045 3.747500
2019-02-27 1114.01 1122.89 1117.896000 1120.2115 -2.315500
2019-02-28 1119.00 1126.55 1118.140000 1121.6395 -3.499500
2019-03-05 1156.00 1169.19 1128.854667 1125.8995 2.955167
2019-03-06 1171.76 1164.94 1131.345333 1126.5530 4.792333
2019-04-11 1208.90 1209.59 1199.685333 1201.9575 -2.272167
2019-04-12 1215.62 1222.73 1200.690667 1203.5790 -2.888333
2019-04-17 1237.00 1240.14 1209.580667 1207.6360 1.944667
2019-04-18 1245.00 1241.47 1214.194000 1207.9030 6.291000
2019-05-09 1162.60 1167.97 1220.416000 1221.8570 -1.441000
2019-05-10 1168.84 1167.64 1215.494000 1219.7595 -4.265500
2019-06-25 1115.08 1087.58 1088.498000 1088.4275 0.070500
2019-06-26 1091.00 1080.32 1090.876667 1086.4465 4.430167
2019-08-20 1195.35 1183.53 1186.074000 1189.0920 -3.018000
2019-08-21 1195.82 1191.58 1184.299333 1191.6845 -7.385167
2019-08-30 1200.35 1190.53 1180.345333 1180.1005 0.244833
2019-09-03 1181.85 1169.55 1180.015333 1180.8405 -0.825167
2019-09-04 1179.45 1182.27 1179.051333 1181.4000 -2.348667
2019-09-06 1209.14 1206.32 1184.714000 1183.2205 1.493500
2019-09-09 1207.08 1205.27 1186.451333 1184.0390 2.412333
2019-10-07 1207.00 1208.25 1220.801333 1222.2175 -1.416167
2019-10-08 1198.77 1190.13 1218.151333 1221.4390 -3.287667
2019-10-23 1240.21 1257.63 1224.645333 1222.1490 2.496333
2019-10-24 1259.11 1259.11 1229.290667 1222.9900 6.300667
2020-02-13 1510.00 1513.39 1471.467333 1472.6400 -1.172667
2020-02-14 1514.53 1518.73 1474.971333 1476.0685 -1.097167
2020-02-18 1514.34 1519.44 1480.818667 1478.0645 2.754167
2020-02-19 1527.20 1524.87 1485.776667 1480.1955 5.581167
2020-03-02 1351.39 1386.32 1456.760000 1459.0270 -2.267000
2020-03-03 1397.68 1337.72 1445.364000 1451.7830 -6.419000
2020-04-08 1203.10 1207.00 1128.777333 1126.9865 1.790833
2020-04-09 1218.18 1206.57 1135.104000 1131.7375 3.366500
2020-06-26 1432.63 1362.54 1433.942000 1433.9940 -0.052000
2020-06-29 1360.34 1397.17 1430.550667 1432.1090 -1.558333
trade_signal signal_change entry_exit
date
2019-01-11 1.0 1.0 0.0
2019-01-14 1.0 0.0 1.0
2019-02-27 0.0 -1.0 0.0
2019-02-28 0.0 0.0 -1.0
2019-03-05 1.0 1.0 0.0
2019-03-06 1.0 0.0 1.0
2019-04-11 0.0 -1.0 0.0
2019-04-12 0.0 0.0 -1.0
2019-04-17 1.0 1.0 0.0
2019-04-18 1.0 0.0 1.0
2019-05-09 0.0 -1.0 0.0
2019-05-10 0.0 0.0 -1.0
2019-06-25 1.0 1.0 0.0
2019-06-26 1.0 0.0 1.0
2019-08-20 0.0 -1.0 0.0
2019-08-21 0.0 0.0 -1.0
2019-08-30 1.0 1.0 0.0
2019-09-03 0.0 -1.0 1.0
2019-09-04 0.0 0.0 -1.0
2019-09-06 1.0 1.0 0.0
2019-09-09 1.0 0.0 1.0
2019-10-07 0.0 -1.0 0.0
2019-10-08 0.0 0.0 -1.0
2019-10-23 1.0 1.0 0.0
2019-10-24 1.0 0.0 1.0
2020-02-13 0.0 -1.0 0.0
2020-02-14 0.0 0.0 -1.0
2020-02-18 1.0 1.0 0.0
2020-02-19 1.0 0.0 1.0
2020-03-02 0.0 -1.0 0.0
2020-03-03 0.0 0.0 -1.0
2020-04-08 1.0 1.0 0.0
2020-04-09 1.0 0.0 1.0
2020-06-26 0.0 -1.0 0.0
2020-06-29 0.0 0.0 -1.0
List the signal change and entry/exit points for SMA_007_SlowMA_25_FastMA_05
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-07 1080.97 1075.92 1055.820 1054.0832 1.7368
2019-01-08 1086.00 1085.37 1063.902 1053.7148 10.1872
2019-05-03 1177.41 1189.55 1204.908 1222.6644 -17.7564
2019-05-06 1172.00 1193.46 1184.360 1223.3272 -38.9672
2019-06-21 1109.86 1125.37 1108.442 1104.4604 3.9816
2019-06-24 1120.00 1116.70 1113.004 1102.3772 10.6268
2019-06-28 1077.23 1082.80 1088.806 1091.4588 -2.6528
2019-07-01 1101.04 1100.00 1085.466 1089.9144 -4.4484
2019-07-02 1104.83 1112.60 1090.470 1088.8360 1.6340
2019-07-03 1118.50 1122.99 1099.004 1088.9580 10.0460
2019-08-20 1195.35 1183.53 1179.350 1179.7852 -0.4352
2019-08-21 1195.82 1191.58 1184.816 1181.5788 3.2372
2019-08-22 1193.80 1191.52 1189.256 1183.3500 5.9060
2019-08-23 1185.17 1153.58 1184.130 1184.2312 -0.1012
2019-08-26 1159.45 1171.18 1178.278 1185.5100 -7.2320
2019-09-05 1193.66 1212.19 1189.756 1182.9648 6.7912
2019-09-06 1209.14 1206.32 1192.172 1182.7464 9.4256
2019-10-02 1196.50 1177.92 1214.660 1214.7932 -0.1332
2019-10-03 1183.34 1189.43 1204.088 1215.4204 -11.3324
2019-10-16 1241.81 1243.00 1225.638 1221.5748 4.0632
2019-10-17 1251.40 1252.80 1234.304 1222.2880 12.0160
2020-02-25 1431.00 1386.32 1466.300 1475.7116 -9.4116
2020-02-26 1394.98 1390.47 1439.420 1472.0404 -32.6204
2020-04-08 1203.10 1207.00 1156.496 1154.0836 2.4124
2020-04-09 1218.18 1206.57 1174.404 1149.7560 24.6480
2020-06-26 1432.63 1362.54 1430.196 1431.4612 -1.2652
2020-06-29 1360.34 1397.17 1419.498 1430.8184 -11.3204
trade_signal signal_change entry_exit
date
2019-01-07 1.0 1.0 0.0
2019-01-08 1.0 0.0 1.0
2019-05-03 0.0 -1.0 0.0
2019-05-06 0.0 0.0 -1.0
2019-06-21 1.0 1.0 0.0
2019-06-24 1.0 0.0 1.0
2019-06-28 0.0 -1.0 0.0
2019-07-01 0.0 0.0 -1.0
2019-07-02 1.0 1.0 0.0
2019-07-03 1.0 0.0 1.0
2019-08-20 0.0 -1.0 0.0
2019-08-21 1.0 1.0 -1.0
2019-08-22 1.0 0.0 1.0
2019-08-23 0.0 -1.0 0.0
2019-08-26 0.0 0.0 -1.0
2019-09-05 1.0 1.0 0.0
2019-09-06 1.0 0.0 1.0
2019-10-02 0.0 -1.0 0.0
2019-10-03 0.0 0.0 -1.0
2019-10-16 1.0 1.0 0.0
2019-10-17 1.0 0.0 1.0
2020-02-25 0.0 -1.0 0.0
2020-02-26 0.0 0.0 -1.0
2020-04-08 1.0 1.0 0.0
2020-04-09 1.0 0.0 1.0
2020-06-26 0.0 -1.0 0.0
2020-06-29 0.0 0.0 -1.0
List the signal change and entry/exit points for SMA_008_SlowMA_25_FastMA_10
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-09 1087.99 1081.65 1059.355 1052.5948 6.7602
2019-01-10 1074.94 1078.83 1062.453 1051.0936 11.3594
2019-05-07 1185.81 1178.86 1220.167 1222.5224 -2.3554
2019-05-08 1177.29 1170.78 1211.240 1221.1320 -9.8920
2019-06-25 1115.08 1087.58 1100.290 1100.0940 0.1960
2019-06-26 1091.00 1080.32 1100.412 1097.1292 3.2828
2019-08-23 1185.17 1153.58 1180.466 1184.2312 -3.7652
2019-08-26 1159.45 1171.18 1180.134 1185.5100 -5.3760
2019-09-09 1207.08 1205.27 1187.612 1183.1044 4.5076
2019-09-10 1196.09 1205.70 1191.064 1185.1424 5.9216
2019-10-07 1207.00 1208.25 1214.621 1216.7980 -2.1770
2019-10-08 1198.77 1190.13 1211.801 1217.6212 -5.8202
2019-10-18 1254.69 1244.41 1222.618 1222.4632 0.1548
2019-10-21 1248.70 1244.28 1226.221 1222.9692 3.2518
2020-02-27 1359.14 1314.95 1458.848 1465.2716 -6.4236
2020-02-28 1274.31 1339.25 1441.434 1459.4540 -18.0200
2020-04-09 1218.18 1206.57 1150.967 1149.7560 1.2110
2020-04-13 1201.50 1210.41 1160.982 1146.3428 14.6392
2020-06-29 1360.34 1397.17 1430.592 1430.8184 -0.2264
2020-06-30 1396.88 1418.05 1427.750 1430.6856 -2.9356
trade_signal signal_change entry_exit
date
2019-01-09 1.0 1.0 0.0
2019-01-10 1.0 0.0 1.0
2019-05-07 0.0 -1.0 0.0
2019-05-08 0.0 0.0 -1.0
2019-06-25 1.0 1.0 0.0
2019-06-26 1.0 0.0 1.0
2019-08-23 0.0 -1.0 0.0
2019-08-26 0.0 0.0 -1.0
2019-09-09 1.0 1.0 0.0
2019-09-10 1.0 0.0 1.0
2019-10-07 0.0 -1.0 0.0
2019-10-08 0.0 0.0 -1.0
2019-10-18 1.0 1.0 0.0
2019-10-21 1.0 0.0 1.0
2020-02-27 0.0 -1.0 0.0
2020-02-28 0.0 0.0 -1.0
2020-04-09 1.0 1.0 0.0
2020-04-13 1.0 0.0 1.0
2020-06-29 0.0 -1.0 0.0
2020-06-30 0.0 0.0 -1.0
List the signal change and entry/exit points for SMA_009_SlowMA_25_FastMA_15
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-14 1053.34 1051.51 1050.952000 1050.1108 0.841200
2019-01-15 1058.01 1086.51 1057.302667 1051.7080 5.594667
2019-04-12 1215.62 1222.73 1200.690667 1201.1992 -0.508533
2019-04-15 1224.09 1226.53 1202.634000 1203.0900 -0.456000
2019-04-16 1230.00 1231.91 1205.438667 1204.4764 0.962267
2019-04-17 1237.00 1240.14 1209.580667 1206.1196 3.461067
2019-05-10 1168.84 1167.64 1215.494000 1217.3460 -1.852000
2019-05-13 1145.24 1136.59 1207.682667 1214.3516 -6.668933
2019-06-28 1077.23 1082.80 1093.763333 1091.4588 2.304533
2019-07-01 1101.04 1100.00 1094.912667 1089.9144 4.998267
2019-08-22 1193.80 1191.52 1182.948667 1183.3500 -0.401333
2019-08-23 1185.17 1153.58 1180.099333 1184.2312 -4.131867
2019-09-06 1209.14 1206.32 1184.714000 1182.7464 1.967600
2019-09-09 1207.08 1205.27 1186.451333 1183.1044 3.346933
2019-10-09 1201.33 1202.40 1216.134667 1218.4264 -2.291733
2019-10-10 1198.60 1209.47 1214.182667 1218.3176 -4.134933
2019-10-23 1240.21 1257.63 1224.645333 1224.4212 0.224133
2019-10-24 1259.11 1259.11 1229.290667 1225.2356 4.055067
2020-03-03 1397.68 1337.72 1445.364000 1452.4996 -7.135600
2020-03-04 1358.96 1381.60 1436.800000 1449.7436 -12.943600
2020-04-14 1239.97 1265.23 1158.657333 1148.3204 10.336933
2020-04-15 1246.51 1257.30 1167.143333 1147.6056 19.537733
2020-06-29 1360.34 1397.17 1430.550667 1430.8184 -0.267733
2020-06-30 1396.88 1418.05 1428.282000 1430.6856 -2.403600
trade_signal signal_change entry_exit
date
2019-01-14 1.0 1.0 0.0
2019-01-15 1.0 0.0 1.0
2019-04-12 0.0 -1.0 0.0
2019-04-15 0.0 0.0 -1.0
2019-04-16 1.0 1.0 0.0
2019-04-17 1.0 0.0 1.0
2019-05-10 0.0 -1.0 0.0
2019-05-13 0.0 0.0 -1.0
2019-06-28 1.0 1.0 0.0
2019-07-01 1.0 0.0 1.0
2019-08-22 0.0 -1.0 0.0
2019-08-23 0.0 0.0 -1.0
2019-09-06 1.0 1.0 0.0
2019-09-09 1.0 0.0 1.0
2019-10-09 0.0 -1.0 0.0
2019-10-10 0.0 0.0 -1.0
2019-10-23 1.0 1.0 0.0
2019-10-24 1.0 0.0 1.0
2020-03-03 0.0 -1.0 0.0
2020-03-04 0.0 0.0 -1.0
2020-04-14 1.0 1.0 0.0
2020-04-15 1.0 0.0 1.0
2020-06-29 0.0 -1.0 0.0
2020-06-30 0.0 0.0 -1.0
List the signal change and entry/exit points for SMA_010_SlowMA_25_FastMA_20
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-17 1087.99 1099.12 1054.9230 1054.6600 0.2630
2019-01-18 1108.59 1107.30 1058.5150 1056.0028 2.5122
2019-03-06 1171.76 1164.94 1126.5530 1126.6740 -0.1210
2019-03-07 1160.50 1150.85 1127.9510 1128.7884 -0.8374
2019-03-08 1133.90 1149.97 1130.1540 1129.7516 0.4024
2019-03-11 1152.00 1179.26 1133.9980 1132.1772 1.8208
2019-04-18 1245.00 1241.47 1207.9030 1208.0772 -0.1742
2019-04-22 1236.67 1253.76 1210.2085 1210.6156 -0.4071
2019-04-24 1270.59 1260.05 1217.3795 1216.2008 1.1787
2019-04-25 1270.30 1267.34 1221.8460 1217.8372 4.0088
2019-05-14 1142.32 1124.86 1210.3690 1211.0148 -0.6458
2019-05-15 1122.55 1170.80 1207.3135 1209.7392 -2.4257
2019-07-02 1104.83 1112.60 1088.9910 1088.8360 0.1550
2019-07-03 1118.50 1122.99 1092.9085 1088.9580 3.9505
2019-08-27 1183.00 1170.82 1183.4895 1186.4208 -2.9313
2019-08-28 1164.87 1173.75 1181.2670 1187.7816 -6.5146
2019-09-05 1193.66 1212.19 1183.2140 1182.9648 0.2492
2019-09-06 1209.14 1206.32 1183.2205 1182.7464 0.4741
2019-09-11 1203.89 1220.00 1186.7625 1187.0992 -0.3367
2019-09-12 1223.47 1234.97 1190.2985 1189.4616 0.8369
2019-09-13 1232.11 1240.03 1193.8340 1190.8152 3.0188
2019-10-11 1224.03 1215.71 1218.0680 1218.6932 -0.6252
2019-10-14 1213.89 1217.77 1217.3750 1219.1932 -1.8182
2019-10-29 1276.00 1260.66 1231.0325 1230.4788 0.5537
2019-10-30 1255.15 1260.70 1235.1715 1231.0692 4.1023
2020-03-03 1397.68 1337.72 1451.7830 1452.4996 -0.7166
2020-03-04 1358.96 1381.60 1448.5925 1449.7436 -1.1511
2020-04-15 1246.51 1257.30 1148.1180 1147.6056 0.5124
2020-04-16 1267.14 1257.43 1156.4300 1149.4668 6.9632
2020-07-01 1419.17 1442.00 1431.0335 1431.5544 -0.5209
trade_signal signal_change entry_exit
date
2019-01-17 1.0 1.0 0.0
2019-01-18 1.0 0.0 1.0
2019-03-06 0.0 -1.0 0.0
2019-03-07 0.0 0.0 -1.0
2019-03-08 1.0 1.0 0.0
2019-03-11 1.0 0.0 1.0
2019-04-18 0.0 -1.0 0.0
2019-04-22 0.0 0.0 -1.0
2019-04-24 1.0 1.0 0.0
2019-04-25 1.0 0.0 1.0
2019-05-14 0.0 -1.0 0.0
2019-05-15 0.0 0.0 -1.0
2019-07-02 1.0 1.0 0.0
2019-07-03 1.0 0.0 1.0
2019-08-27 0.0 -1.0 0.0
2019-08-28 0.0 0.0 -1.0
2019-09-05 1.0 1.0 0.0
2019-09-06 1.0 0.0 1.0
2019-09-11 0.0 -1.0 0.0
2019-09-12 1.0 1.0 -1.0
2019-09-13 1.0 0.0 1.0
2019-10-11 0.0 -1.0 0.0
2019-10-14 0.0 0.0 -1.0
2019-10-29 1.0 1.0 0.0
2019-10-30 1.0 0.0 1.0
2020-03-03 0.0 -1.0 0.0
2020-03-04 0.0 0.0 -1.0
2020-04-15 1.0 1.0 0.0
2020-04-16 1.0 0.0 1.0
2020-07-01 0.0 -1.0 0.0
List the signal change and entry/exit points for SMA_011_SlowMA_30_FastMA_05
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-07 1080.97 1075.92 1055.820 1054.187333 1.632667
2019-01-08 1086.00 1085.37 1063.902 1055.585333 8.316667
2019-05-03 1177.41 1189.55 1204.908 1217.058667 -12.150667
2019-05-06 1172.00 1193.46 1184.360 1216.585667 -32.225667
2019-06-24 1120.00 1116.70 1113.004 1111.498667 1.505333
2019-06-25 1115.08 1087.58 1109.472 1109.865000 -0.393000
2019-06-26 1091.00 1080.32 1104.634 1108.380333 -3.746333
2019-07-03 1118.50 1122.99 1099.004 1097.441667 1.562333
2019-07-05 1119.37 1132.66 1110.210 1096.668667 13.541333
2019-08-26 1159.45 1171.18 1178.278 1178.531667 -0.253667
2019-08-27 1183.00 1170.82 1175.736 1179.110333 -3.374333
2019-09-05 1193.66 1212.19 1189.756 1188.110667 1.645333
2019-09-06 1209.14 1206.32 1192.172 1190.456667 1.715333
2019-10-03 1183.34 1189.43 1204.088 1208.212000 -4.124000
2019-10-04 1194.29 1210.96 1201.090 1208.860000 -7.770000
2019-10-16 1241.81 1243.00 1225.638 1219.628333 6.009667
2019-10-17 1251.40 1252.80 1234.304 1220.982000 13.322000
2020-02-25 1431.00 1386.32 1466.300 1471.076333 -4.776333
2020-02-26 1394.98 1390.47 1439.420 1469.424333 -30.004333
2020-04-13 1201.50 1210.41 1197.946 1179.157000 18.789000
2020-04-14 1239.97 1265.23 1214.354 1175.120667 39.233333
2020-06-29 1360.34 1397.17 1419.498 1425.306333 -5.808333
2020-06-30 1396.88 1418.05 1410.312 1426.402000 -16.090000
trade_signal signal_change entry_exit
date
2019-01-07 1.0 1.0 0.0
2019-01-08 1.0 0.0 1.0
2019-05-03 0.0 -1.0 0.0
2019-05-06 0.0 0.0 -1.0
2019-06-24 1.0 1.0 0.0
2019-06-25 0.0 -1.0 1.0
2019-06-26 0.0 0.0 -1.0
2019-07-03 1.0 1.0 0.0
2019-07-05 1.0 0.0 1.0
2019-08-26 0.0 -1.0 0.0
2019-08-27 0.0 0.0 -1.0
2019-09-05 1.0 1.0 0.0
2019-09-06 1.0 0.0 1.0
2019-10-03 0.0 -1.0 0.0
2019-10-04 0.0 0.0 -1.0
2019-10-16 1.0 1.0 0.0
2019-10-17 1.0 0.0 1.0
2020-02-25 0.0 -1.0 0.0
2020-02-26 0.0 0.0 -1.0
2020-04-13 1.0 1.0 0.0
2020-04-14 1.0 0.0 1.0
2020-06-29 0.0 -1.0 0.0
2020-06-30 0.0 0.0 -1.0
List the signal change and entry/exit points for SMA_012_SlowMA_30_FastMA_10
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-09 1087.99 1081.65 1059.355 1057.303667 2.051333
2019-01-10 1074.94 1078.83 1062.453 1058.066667 4.386333
2019-05-08 1177.29 1170.78 1211.240 1215.333000 -4.093000
2019-05-09 1162.60 1167.97 1201.303 1214.998333 -13.695333
2019-07-02 1104.83 1112.60 1099.971 1098.490000 1.481000
2019-07-03 1118.50 1122.99 1101.819 1097.441667 4.377333
2019-08-27 1183.00 1170.82 1177.543 1179.110333 -1.567333
2019-08-28 1164.87 1173.75 1178.493 1180.010667 -1.517667
2019-09-10 1196.09 1205.70 1191.064 1187.920333 3.143667
2019-09-11 1203.89 1220.00 1195.982 1187.653667 8.328333
2019-10-09 1201.33 1202.40 1207.447 1212.366667 -4.919667
2019-10-10 1198.60 1209.47 1204.165 1213.557333 -9.392333
2019-10-18 1254.69 1244.41 1222.618 1222.251667 0.366333
2019-10-21 1248.70 1244.28 1226.221 1223.552000 2.669000
2020-02-27 1359.14 1314.95 1458.848 1465.569667 -6.721667
2020-02-28 1274.31 1339.25 1441.434 1462.238000 -20.804000
2020-04-15 1246.51 1257.30 1182.409 1172.440000 9.969000
2020-04-16 1267.14 1257.43 1197.942 1168.301000 29.641000
2020-07-01 1419.17 1442.00 1426.696 1428.655333 -1.959333
trade_signal signal_change entry_exit
date
2019-01-09 1.0 1.0 0.0
2019-01-10 1.0 0.0 1.0
2019-05-08 0.0 -1.0 0.0
2019-05-09 0.0 0.0 -1.0
2019-07-02 1.0 1.0 0.0
2019-07-03 1.0 0.0 1.0
2019-08-27 0.0 -1.0 0.0
2019-08-28 0.0 0.0 -1.0
2019-09-10 1.0 1.0 0.0
2019-09-11 1.0 0.0 1.0
2019-10-09 0.0 -1.0 0.0
2019-10-10 0.0 0.0 -1.0
2019-10-18 1.0 1.0 0.0
2019-10-21 1.0 0.0 1.0
2020-02-27 0.0 -1.0 0.0
2020-02-28 0.0 0.0 -1.0
2020-04-15 1.0 1.0 0.0
2020-04-16 1.0 0.0 1.0
2020-07-01 0.0 -1.0 0.0
List the signal change and entry/exit points for SMA_013_SlowMA_30_FastMA_15
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-15 1058.01 1086.51 1057.302667 1056.861333 0.441333
2019-01-16 1090.00 1089.51 1064.292000 1056.190000 8.102000
2019-05-13 1145.24 1136.59 1207.682667 1213.500667 -5.818000
2019-05-14 1142.32 1124.86 1197.967333 1211.030000 -13.062667
2019-07-03 1118.50 1122.99 1099.942667 1097.441667 2.501000
2019-07-05 1119.37 1132.66 1102.719333 1096.668667 6.050667
2019-08-29 1186.42 1194.24 1180.236667 1181.577333 -1.340667
2019-08-30 1200.35 1190.53 1180.345333 1183.543333 -3.198000
2019-09-11 1203.89 1220.00 1189.233333 1187.653667 1.579667
2019-09-12 1223.47 1234.97 1192.126000 1188.212667 3.913333
2019-10-11 1224.03 1215.71 1213.240667 1214.273000 -1.032333
2019-10-14 1213.89 1217.77 1212.112667 1215.181000 -3.068333
2019-10-24 1259.11 1259.11 1229.290667 1226.794333 2.496333
2019-10-25 1252.00 1264.30 1232.846667 1227.603333 5.243333
2020-03-02 1351.39 1386.32 1456.760000 1460.110000 -3.350000
2020-03-03 1397.68 1337.72 1445.364000 1455.383333 -10.019333
2020-04-16 1267.14 1257.43 1177.530667 1168.301000 9.229667
2020-04-17 1281.70 1279.00 1185.269333 1167.109000 18.160333
2020-07-01 1419.17 1442.00 1426.768667 1428.655333 -1.886667
trade_signal signal_change entry_exit
date
2019-01-15 1.0 1.0 0.0
2019-01-16 1.0 0.0 1.0
2019-05-13 0.0 -1.0 0.0
2019-05-14 0.0 0.0 -1.0
2019-07-03 1.0 1.0 0.0
2019-07-05 1.0 0.0 1.0
2019-08-29 0.0 -1.0 0.0
2019-08-30 0.0 0.0 -1.0
2019-09-11 1.0 1.0 0.0
2019-09-12 1.0 0.0 1.0
2019-10-11 0.0 -1.0 0.0
2019-10-14 0.0 0.0 -1.0
2019-10-24 1.0 1.0 0.0
2019-10-25 1.0 0.0 1.0
2020-03-02 0.0 -1.0 0.0
2020-03-03 0.0 0.0 -1.0
2020-04-16 1.0 1.0 0.0
2020-04-17 1.0 0.0 1.0
2020-07-01 0.0 -1.0 0.0
List the signal change and entry/exit points for SMA_014_SlowMA_30_FastMA_20
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-18 1108.59 1107.30 1058.5150 1057.109667 1.405333
2019-01-22 1096.00 1078.63 1061.2675 1057.128000 4.139500
2019-05-14 1142.32 1124.86 1210.3690 1211.030000 -0.661000
2019-05-15 1122.55 1170.80 1207.3135 1209.872000 -2.558500
2019-07-05 1119.37 1132.66 1097.1535 1096.668667 0.484833
2019-07-08 1125.87 1116.79 1099.5745 1095.717000 3.857500
2019-08-29 1186.42 1194.24 1180.3900 1181.577333 -1.187333
2019-08-30 1200.35 1190.53 1180.1005 1183.543333 -3.442833
2019-09-12 1223.47 1234.97 1190.2985 1188.212667 2.085833
2019-09-13 1232.11 1240.03 1193.8340 1189.154333 4.679667
2019-10-16 1241.81 1243.00 1218.5105 1219.628333 -1.117833
2019-10-17 1251.40 1252.80 1219.2130 1220.982000 -1.769000
2019-10-29 1276.00 1260.66 1231.0325 1230.541000 0.491500
2019-10-30 1255.15 1260.70 1235.1715 1231.476000 3.695500
2020-02-28 1274.31 1339.25 1461.3500 1462.238000 -0.888000
2020-03-02 1351.39 1386.32 1459.0270 1460.110000 -1.083000
2020-04-20 1269.89 1261.15 1174.4435 1165.956000 8.487500
2020-04-21 1242.71 1212.16 1182.3450 1165.835000 16.510000
trade_signal signal_change entry_exit
date
2019-01-18 1.0 1.0 0.0
2019-01-22 1.0 0.0 1.0
2019-05-14 0.0 -1.0 0.0
2019-05-15 0.0 0.0 -1.0
2019-07-05 1.0 1.0 0.0
2019-07-08 1.0 0.0 1.0
2019-08-29 0.0 -1.0 0.0
2019-08-30 0.0 0.0 -1.0
2019-09-12 1.0 1.0 0.0
2019-09-13 1.0 0.0 1.0
2019-10-16 0.0 -1.0 0.0
2019-10-17 0.0 0.0 -1.0
2019-10-29 1.0 1.0 0.0
2019-10-30 1.0 0.0 1.0
2020-02-28 0.0 -1.0 0.0
2020-03-02 0.0 0.0 -1.0
2020-04-20 1.0 1.0 0.0
2020-04-21 1.0 0.0 1.0
List the signal change and entry/exit points for SMA_015_SlowMA_35_FastMA_05
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-07 1080.97 1075.92 1055.820 1053.639714 2.180286
2019-01-08 1086.00 1085.37 1063.902 1054.519429 9.382571
2019-05-03 1177.41 1189.55 1204.908 1215.875143 -10.967143
2019-05-06 1172.00 1193.46 1184.360 1215.965429 -31.605429
2019-07-05 1119.37 1132.66 1110.210 1105.951143 4.258857
2019-07-08 1125.87 1116.79 1117.008 1104.016571 12.991429
2019-08-28 1164.87 1173.75 1172.170 1175.441429 -3.271429
2019-08-29 1186.42 1194.24 1172.714 1176.874571 -4.160571
2019-08-30 1200.35 1190.53 1180.104 1178.165714 1.938286
2019-09-03 1181.85 1169.55 1179.778 1178.709714 1.068286
2019-10-03 1183.34 1189.43 1204.088 1204.869714 -0.781714
2019-10-04 1194.29 1210.96 1201.090 1206.059429 -4.969429
2019-10-15 1221.50 1242.24 1217.518 1212.200286 5.317714
2019-10-16 1241.81 1243.00 1225.638 1214.262571 11.375429
2020-02-26 1394.98 1390.47 1439.420 1462.047429 -22.627429
2020-02-27 1359.14 1314.95 1399.012 1459.757143 -60.745143
2020-04-14 1239.97 1265.23 1214.354 1202.026571 12.327429
2020-04-15 1246.51 1257.30 1229.302 1198.340286 30.961714
2020-06-30 1396.88 1418.05 1410.312 1418.019143 -7.707143
2020-07-01 1419.17 1442.00 1412.172 1419.928286 -7.756286
trade_signal signal_change entry_exit
date
2019-01-07 1.0 1.0 0.0
2019-01-08 1.0 0.0 1.0
2019-05-03 0.0 -1.0 0.0
2019-05-06 0.0 0.0 -1.0
2019-07-05 1.0 1.0 0.0
2019-07-08 1.0 0.0 1.0
2019-08-28 0.0 -1.0 0.0
2019-08-29 0.0 0.0 -1.0
2019-08-30 1.0 1.0 0.0
2019-09-03 1.0 0.0 1.0
2019-10-03 0.0 -1.0 0.0
2019-10-04 0.0 0.0 -1.0
2019-10-15 1.0 1.0 0.0
2019-10-16 1.0 0.0 1.0
2020-02-26 0.0 -1.0 0.0
2020-02-27 0.0 0.0 -1.0
2020-04-14 1.0 1.0 0.0
2020-04-15 1.0 0.0 1.0
2020-06-30 0.0 -1.0 0.0
2020-07-01 0.0 0.0 -1.0
List the signal change and entry/exit points for SMA_016_SlowMA_35_FastMA_10
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-09 1087.99 1081.65 1059.355 1054.822286 4.532714
2019-01-10 1074.94 1078.83 1062.453 1055.124000 7.329000
2019-05-08 1177.29 1170.78 1211.240 1214.783429 -3.543429
2019-05-09 1162.60 1167.97 1201.303 1213.113143 -11.810143
2019-07-09 1110.32 1124.29 1103.666 1102.745429 0.920571
2019-07-10 1132.32 1140.91 1108.999 1102.638286 6.360714
2019-09-04 1179.45 1182.27 1178.902 1179.532857 -0.630857
2019-09-05 1193.66 1212.19 1180.963 1181.402857 -0.439857
2019-09-09 1207.08 1205.27 1187.612 1185.197143 2.414857
2019-09-10 1196.09 1205.70 1191.064 1187.096857 3.967143
2019-10-10 1198.60 1209.47 1204.165 1207.644857 -3.479857
2019-10-11 1224.03 1215.71 1203.141 1208.336000 -5.195000
2019-10-17 1251.40 1252.80 1219.273 1216.521143 2.751857
2019-10-18 1254.69 1244.41 1222.618 1217.954571 4.663429
2020-02-27 1359.14 1314.95 1458.848 1459.757143 -0.909143
2020-02-28 1274.31 1339.25 1441.434 1457.877429 -16.443429
2020-04-16 1267.14 1257.43 1197.942 1194.539143 3.402857
2020-04-17 1281.70 1279.00 1214.139 1193.512000 20.627000
trade_signal signal_change entry_exit
date
2019-01-09 1.0 1.0 0.0
2019-01-10 1.0 0.0 1.0
2019-05-08 0.0 -1.0 0.0
2019-05-09 0.0 0.0 -1.0
2019-07-09 1.0 1.0 0.0
2019-07-10 1.0 0.0 1.0
2019-09-04 0.0 -1.0 0.0
2019-09-05 0.0 0.0 -1.0
2019-09-09 1.0 1.0 0.0
2019-09-10 1.0 0.0 1.0
2019-10-10 0.0 -1.0 0.0
2019-10-11 0.0 0.0 -1.0
2019-10-17 1.0 1.0 0.0
2019-10-18 1.0 0.0 1.0
2020-02-27 0.0 -1.0 0.0
2020-02-28 0.0 0.0 -1.0
2020-04-16 1.0 1.0 0.0
2020-04-17 1.0 0.0 1.0
List the signal change and entry/exit points for SMA_017_SlowMA_35_FastMA_15
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-16 1090.00 1089.51 1064.292000 1059.712571 4.579429
2019-01-17 1087.99 1099.12 1067.710000 1060.946286 6.763714
2019-05-13 1145.24 1136.59 1207.682667 1209.126000 -1.443333
2019-05-14 1142.32 1124.86 1197.967333 1207.054000 -9.086667
2019-07-08 1125.87 1116.79 1104.752000 1104.016571 0.735429
2019-07-09 1110.32 1124.29 1106.778667 1102.745429 4.033238
2019-09-04 1179.45 1182.27 1179.051333 1179.532857 -0.481524
2019-09-05 1193.66 1212.19 1182.247333 1181.402857 0.844476
2019-09-06 1209.14 1206.32 1184.714000 1183.090857 1.623143
2019-09-10 1196.09 1205.70 1186.802000 1187.096857 -0.294857
2019-09-11 1203.89 1220.00 1189.233333 1189.152571 0.080762
2019-09-12 1223.47 1234.97 1192.126000 1191.873714 0.252286
2019-10-16 1241.81 1243.00 1213.510667 1214.262571 -0.751905
2019-10-17 1251.40 1252.80 1214.211333 1216.521143 -2.309810
2019-10-23 1240.21 1257.63 1224.645333 1223.690571 0.954762
2019-10-24 1259.11 1259.11 1229.290667 1225.031143 4.259524
2020-03-02 1351.39 1386.32 1456.760000 1456.921143 -0.161143
2020-03-03 1397.68 1337.72 1445.364000 1454.314286 -8.950286
2020-04-20 1269.89 1261.15 1195.328667 1191.280571 4.048095
2020-04-21 1242.71 1212.16 1199.718667 1186.304571 13.414095
trade_signal signal_change entry_exit
date
2019-01-16 1.0 1.0 0.0
2019-01-17 1.0 0.0 1.0
2019-05-13 0.0 -1.0 0.0
2019-05-14 0.0 0.0 -1.0
2019-07-08 1.0 1.0 0.0
2019-07-09 1.0 0.0 1.0
2019-09-04 0.0 -1.0 0.0
2019-09-05 1.0 1.0 -1.0
2019-09-06 1.0 0.0 1.0
2019-09-10 0.0 -1.0 0.0
2019-09-11 1.0 1.0 -1.0
2019-09-12 1.0 0.0 1.0
2019-10-16 0.0 -1.0 0.0
2019-10-17 0.0 0.0 -1.0
2019-10-23 1.0 1.0 0.0
2019-10-24 1.0 0.0 1.0
2020-03-02 0.0 -1.0 0.0
2020-03-03 0.0 0.0 -1.0
2020-04-20 1.0 1.0 0.0
2020-04-21 1.0 0.0 1.0
List the signal change and entry/exit points for SMA_018_SlowMA_35_FastMA_20
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-23 1086.86 1084.41 1065.9255 1061.851714 4.073786
2019-01-24 1082.51 1084.00 1070.8920 1061.118857 9.773143
2019-05-16 1171.84 1184.50 1204.5315 1206.695429 -2.163929
2019-05-17 1175.83 1168.78 1200.8970 1206.595714 -5.698714
2019-07-10 1132.32 1140.91 1104.6445 1102.638286 2.006214
2019-07-11 1146.16 1144.08 1107.8935 1102.342286 5.551214
2019-09-09 1207.08 1205.27 1184.0390 1185.197143 -1.158143
2019-09-10 1196.09 1205.70 1185.5990 1187.096857 -1.497857
2019-09-16 1230.44 1231.63 1196.4550 1194.459429 1.995571
2019-09-17 1231.63 1229.88 1197.9270 1194.117714 3.809286
2019-10-23 1240.21 1257.63 1222.1490 1223.690571 -1.541571
2019-10-24 1259.11 1259.11 1222.9900 1225.031143 -2.041143
2019-10-29 1276.00 1260.66 1231.0325 1230.649714 0.382786
2019-10-30 1255.15 1260.70 1235.1715 1231.812571 3.358929
2020-03-03 1397.68 1337.72 1451.7830 1454.314286 -2.531286
2020-03-04 1358.96 1381.60 1448.5925 1452.644857 -4.052357
2020-04-22 1241.11 1258.41 1188.7650 1184.038571 4.726429
2020-04-23 1265.74 1271.17 1197.2425 1180.883429 16.359071
trade_signal signal_change entry_exit
date
2019-01-23 1.0 1.0 0.0
2019-01-24 1.0 0.0 1.0
2019-05-16 0.0 -1.0 0.0
2019-05-17 0.0 0.0 -1.0
2019-07-10 1.0 1.0 0.0
2019-07-11 1.0 0.0 1.0
2019-09-09 0.0 -1.0 0.0
2019-09-10 0.0 0.0 -1.0
2019-09-16 1.0 1.0 0.0
2019-09-17 1.0 0.0 1.0
2019-10-23 0.0 -1.0 0.0
2019-10-24 0.0 0.0 -1.0
2019-10-29 1.0 1.0 0.0
2019-10-30 1.0 0.0 1.0
2020-03-03 0.0 -1.0 0.0
2020-03-04 0.0 0.0 -1.0
2020-04-22 1.0 1.0 0.0
2020-04-23 1.0 0.0 1.0
List the signal change and entry/exit points for SMA_019_SlowMA_40_FastMA_05
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-08 1086.00 1085.37 1063.902 1055.79350 8.10850
2019-01-09 1087.99 1081.65 1069.296 1055.46900 13.82700
2019-05-03 1177.41 1189.55 1204.908 1211.84250 -6.93450
2019-05-06 1172.00 1193.46 1184.360 1212.92975 -28.56975
2019-07-08 1125.87 1116.79 1117.008 1110.62425 6.38375
2019-07-09 1110.32 1124.29 1121.866 1109.54050 12.32550
2019-10-04 1194.29 1210.96 1201.090 1202.64450 -1.55450
2019-10-07 1207.00 1208.25 1198.512 1203.12825 -4.61625
2019-10-14 1213.89 1217.77 1207.096 1206.91500 0.18100
2019-10-15 1221.50 1242.24 1217.518 1207.96000 9.55800
2020-02-26 1394.98 1390.47 1439.420 1449.46925 -10.04925
2020-02-27 1359.14 1314.95 1399.012 1448.85025 -49.83825
2020-04-16 1267.14 1257.43 1239.388 1225.14925 14.23875
2020-04-17 1281.70 1279.00 1253.874 1219.19950 34.67450
2020-06-30 1396.88 1418.05 1410.312 1412.05825 -1.74625
2020-07-01 1419.17 1442.00 1412.172 1414.38275 -2.21075
trade_signal signal_change entry_exit
date
2019-01-08 1.0 1.0 0.0
2019-01-09 1.0 0.0 1.0
2019-05-03 0.0 -1.0 0.0
2019-05-06 0.0 0.0 -1.0
2019-07-08 1.0 1.0 0.0
2019-07-09 1.0 0.0 1.0
2019-10-04 0.0 -1.0 0.0
2019-10-07 0.0 0.0 -1.0
2019-10-14 1.0 1.0 0.0
2019-10-15 1.0 0.0 1.0
2020-02-26 0.0 -1.0 0.0
2020-02-27 0.0 0.0 -1.0
2020-04-16 1.0 1.0 0.0
2020-04-17 1.0 0.0 1.0
2020-06-30 0.0 -1.0 0.0
2020-07-01 0.0 0.0 -1.0
List the signal change and entry/exit points for SMA_020_SlowMA_40_FastMA_10
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-09 1087.99 1081.65 1059.355 1055.46900 3.88600
2019-01-10 1074.94 1078.83 1062.453 1055.51425 6.93875
2019-05-08 1177.29 1170.78 1211.240 1212.25800 -1.01800
2019-05-09 1162.60 1167.97 1201.303 1211.48075 -10.17775
2019-07-11 1146.16 1144.08 1115.375 1110.12900 5.24600
2019-07-12 1142.93 1145.34 1122.246 1109.49250 12.75350
2019-10-10 1198.60 1209.47 1204.165 1204.79125 -0.62625
2019-10-11 1224.03 1215.71 1203.141 1205.95100 -2.81000
2019-10-16 1241.81 1243.00 1212.936 1209.44675 3.48925
2019-10-17 1251.40 1252.80 1219.273 1210.97725 8.29575
2020-02-28 1274.31 1339.25 1441.434 1448.84675 -7.41275
2020-03-02 1351.39 1386.32 1428.193 1449.28775 -21.09475
2020-04-20 1269.89 1261.15 1230.984 1213.64175 17.34225
2020-04-21 1242.71 1212.16 1233.881 1208.44925 25.43175
trade_signal signal_change entry_exit
date
2019-01-09 1.0 1.0 0.0
2019-01-10 1.0 0.0 1.0
2019-05-08 0.0 -1.0 0.0
2019-05-09 0.0 0.0 -1.0
2019-07-11 1.0 1.0 0.0
2019-07-12 1.0 0.0 1.0
2019-10-10 0.0 -1.0 0.0
2019-10-11 0.0 0.0 -1.0
2019-10-16 1.0 1.0 0.0
2019-10-17 1.0 0.0 1.0
2020-02-28 0.0 -1.0 0.0
2020-03-02 0.0 0.0 -1.0
2020-04-20 1.0 1.0 0.0
2020-04-21 1.0 0.0 1.0
List the signal change and entry/exit points for SMA_021_SlowMA_40_FastMA_15
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-15 1058.01 1086.51 1057.302667 1056.77875 0.523917
2019-01-16 1090.00 1089.51 1064.292000 1057.24025 7.051750
2019-05-13 1145.24 1136.59 1207.682667 1209.51575 -1.833083
2019-05-14 1142.32 1124.86 1197.967333 1207.92350 -9.956167
2019-07-11 1146.16 1144.08 1111.794667 1110.12900 1.665667
2019-07-12 1142.93 1145.34 1113.937333 1109.49250 4.444833
2020-03-03 1397.68 1337.72 1445.364000 1448.69275 -3.328750
2020-03-04 1358.96 1381.60 1436.800000 1448.28750 -11.487500
2020-04-22 1241.11 1258.41 1206.149333 1205.25150 0.897833
2020-04-23 1265.74 1271.17 1217.420667 1202.26900 15.151667
trade_signal signal_change entry_exit
date
2019-01-15 1.0 1.0 0.0
2019-01-16 1.0 0.0 1.0
2019-05-13 0.0 -1.0 0.0
2019-05-14 0.0 0.0 -1.0
2019-07-11 1.0 1.0 0.0
2019-07-12 1.0 0.0 1.0
2020-03-03 0.0 -1.0 0.0
2020-03-04 0.0 0.0 -1.0
2020-04-22 1.0 1.0 0.0
2020-04-23 1.0 0.0 1.0
List the signal change and entry/exit points for SMA_022_SlowMA_40_FastMA_20
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-22 1096.00 1078.63 1061.2675 1061.21300 0.05450
2019-01-23 1086.86 1084.41 1065.9255 1062.23750 3.68800
2019-05-16 1171.84 1184.50 1204.5315 1206.08375 -1.55225
2019-05-17 1175.83 1168.78 1200.8970 1204.40000 -3.50300
2019-07-12 1142.93 1145.34 1110.6100 1109.49250 1.11750
2019-07-15 1145.34 1150.51 1113.8205 1108.64275 5.17775
2020-03-05 1345.55 1314.76 1442.0280 1446.27875 -4.25075
2020-03-06 1269.95 1295.74 1433.0165 1443.54625 -10.52975
2020-04-24 1255.00 1276.60 1202.9265 1201.31025 1.61625
2020-04-27 1292.00 1270.86 1210.9565 1199.60050 11.35600
trade_signal signal_change entry_exit
date
2019-01-22 1.0 1.0 0.0
2019-01-23 1.0 0.0 1.0
2019-05-16 0.0 -1.0 0.0
2019-05-17 0.0 0.0 -1.0
2019-07-12 1.0 1.0 0.0
2019-07-15 1.0 0.0 1.0
2020-03-05 0.0 -1.0 0.0
2020-03-06 0.0 0.0 -1.0
2020-04-24 1.0 1.0 0.0
2020-04-27 1.0 0.0 1.0
List the signal change and entry/exit points for SMA_023_SlowMA_45_FastMA_05
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-08 1086.00 1085.37 1063.902 1058.283333 5.618667
2019-01-09 1087.99 1081.65 1069.296 1058.187111 11.108889
2019-05-03 1177.41 1189.55 1204.908 1205.791556 -0.883556
2019-05-06 1172.00 1193.46 1184.360 1206.790222 -22.430222
2019-07-09 1110.32 1124.29 1121.866 1116.896222 4.969778
2019-07-10 1132.32 1140.91 1127.528 1115.728444 11.799556
2019-10-07 1207.00 1208.25 1198.512 1200.488000 -1.976000
2019-10-08 1198.77 1190.13 1195.338 1201.274222 -5.936222
2019-10-10 1198.60 1209.47 1204.242 1202.716000 1.526000
2019-10-11 1224.03 1215.71 1205.192 1202.927556 2.264444
2020-02-27 1359.14 1314.95 1399.012 1437.908667 -38.896667
2020-02-28 1274.31 1339.25 1370.170 1437.655778 -67.485778
2020-04-17 1281.70 1279.00 1253.874 1252.475556 1.398444
2020-04-20 1269.89 1261.15 1264.022 1246.870222 17.151778
trade_signal signal_change entry_exit
date
2019-01-08 1.0 1.0 0.0
2019-01-09 1.0 0.0 1.0
2019-05-03 0.0 -1.0 0.0
2019-05-06 0.0 0.0 -1.0
2019-07-09 1.0 1.0 0.0
2019-07-10 1.0 0.0 1.0
2019-10-07 0.0 -1.0 0.0
2019-10-08 0.0 0.0 -1.0
2019-10-10 1.0 1.0 0.0
2019-10-11 1.0 0.0 1.0
2020-02-27 0.0 -1.0 0.0
2020-02-28 0.0 0.0 -1.0
2020-04-17 1.0 1.0 0.0
2020-04-20 1.0 0.0 1.0
List the signal change and entry/exit points for SMA_024_SlowMA_45_FastMA_10
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-09 1087.99 1081.65 1059.355 1058.187111 1.167889
2019-01-10 1074.94 1078.83 1062.453 1058.350222 4.102778
2019-05-09 1162.60 1167.97 1201.303 1207.458222 -6.155222
2019-05-10 1168.84 1167.64 1190.325 1207.831333 -17.506333
2019-07-11 1146.16 1144.08 1115.375 1114.955556 0.419444
2019-07-12 1142.93 1145.34 1122.246 1114.390222 7.855778
2019-10-14 1213.89 1217.77 1202.804 1203.569111 -0.765111
2019-10-15 1221.50 1242.24 1206.428 1205.074444 1.353556
2019-10-16 1241.81 1243.00 1212.936 1206.102667 6.833333
2020-03-02 1351.39 1386.32 1428.193 1438.586667 -10.393667
2020-03-03 1397.68 1337.72 1410.021 1438.036667 -28.015667
2020-04-22 1241.11 1258.41 1241.466 1234.256889 7.209111
2020-04-23 1265.74 1271.17 1247.883 1228.619111 19.263889
trade_signal signal_change entry_exit
date
2019-01-09 1.0 1.0 0.0
2019-01-10 1.0 0.0 1.0
2019-05-09 0.0 -1.0 0.0
2019-05-10 0.0 0.0 -1.0
2019-07-11 1.0 1.0 0.0
2019-07-12 1.0 0.0 1.0
2019-10-14 0.0 -1.0 0.0
2019-10-15 1.0 1.0 -1.0
2019-10-16 1.0 0.0 1.0
2020-03-02 0.0 -1.0 0.0
2020-03-03 0.0 0.0 -1.0
2020-04-22 1.0 1.0 0.0
2020-04-23 1.0 0.0 1.0
List the signal change and entry/exit points for SMA_025_SlowMA_45_FastMA_15
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-16 1090.00 1089.51 1064.292000 1057.546444 6.745556
2019-01-17 1087.99 1099.12 1067.710000 1058.037556 9.672444
2019-05-14 1142.32 1124.86 1197.967333 1206.325111 -8.357778
2019-05-15 1122.55 1170.80 1192.017333 1205.737333 -13.720000
2019-07-15 1145.34 1150.51 1115.613333 1114.002222 1.611111
2019-07-16 1146.73 1153.46 1118.064000 1113.687111 4.376889
2020-03-04 1358.96 1381.60 1436.800000 1438.635778 -1.835778
2020-03-05 1345.55 1314.76 1423.208667 1438.081333 -14.872667
2020-04-24 1255.00 1276.60 1228.058667 1223.277111 4.781556
2020-04-27 1292.00 1270.86 1239.936000 1218.552667 21.383333
trade_signal signal_change entry_exit
date
2019-01-16 1.0 1.0 0.0
2019-01-17 1.0 0.0 1.0
2019-05-14 0.0 -1.0 0.0
2019-05-15 0.0 0.0 -1.0
2019-07-15 1.0 1.0 0.0
2019-07-16 1.0 0.0 1.0
2020-03-04 0.0 -1.0 0.0
2020-03-05 0.0 0.0 -1.0
2020-04-24 1.0 1.0 0.0
2020-04-27 1.0 0.0 1.0
List the signal change and entry/exit points for SMA_026_SlowMA_45_FastMA_20
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-22 1096.00 1078.63 1061.2675 1060.006444 1.261056
2019-01-23 1086.86 1084.41 1065.9255 1060.669333 5.256167
2019-05-16 1171.84 1184.50 1204.5315 1205.413778 -0.882278
2019-05-17 1175.83 1168.78 1200.8970 1204.886000 -3.989000
2019-07-16 1146.73 1153.46 1116.7990 1113.687111 3.111889
2019-07-17 1150.92 1146.74 1118.8740 1113.912667 4.961333
2020-03-06 1269.95 1295.74 1433.0165 1437.111333 -4.094833
2020-03-09 1204.96 1215.79 1419.8505 1433.713778 -13.863278
2020-04-28 1283.20 1232.59 1215.2705 1214.391111 0.879389
2020-04-29 1345.00 1342.18 1224.2820 1213.410222 10.871778
trade_signal signal_change entry_exit
date
2019-01-22 1.0 1.0 0.0
2019-01-23 1.0 0.0 1.0
2019-05-16 0.0 -1.0 0.0
2019-05-17 0.0 0.0 -1.0
2019-07-16 1.0 1.0 0.0
2019-07-17 1.0 0.0 1.0
2020-03-06 0.0 -1.0 0.0
2020-03-09 0.0 0.0 -1.0
2020-04-28 1.0 1.0 0.0
2020-04-29 1.0 0.0 1.0
List the signal change and entry/exit points for SMA_027_SlowMA_50_FastMA_05
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-08 1086.00 1085.37 1063.902 1059.6982 4.2038
2019-01-09 1087.99 1081.65 1069.296 1059.2594 10.0366
2019-05-06 1172.00 1193.46 1184.360 1198.8572 -14.4972
2019-05-07 1185.81 1178.86 1180.340 1200.0878 -19.7478
2019-07-10 1132.32 1140.91 1127.528 1122.5916 4.9364
2019-07-11 1146.16 1144.08 1131.746 1121.4940 10.2520
2019-10-04 1194.29 1210.96 1201.090 1203.1014 -2.0114
2019-10-07 1207.00 1208.25 1198.512 1202.3620 -3.8500
2019-10-10 1198.60 1209.47 1204.242 1200.6412 3.6008
2019-10-11 1224.03 1215.71 1205.192 1200.7198 4.4722
2020-02-27 1359.14 1314.95 1399.012 1429.6210 -30.6090
2020-02-28 1274.31 1339.25 1370.170 1429.1920 -59.0220
2020-04-24 1255.00 1276.60 1255.898 1252.8178 3.0802
2020-04-27 1292.00 1270.86 1257.840 1247.9672 9.8728
trade_signal signal_change entry_exit
date
2019-01-08 1.0 1.0 0.0
2019-01-09 1.0 0.0 1.0
2019-05-06 0.0 -1.0 0.0
2019-05-07 0.0 0.0 -1.0
2019-07-10 1.0 1.0 0.0
2019-07-11 1.0 0.0 1.0
2019-10-04 0.0 -1.0 0.0
2019-10-07 0.0 0.0 -1.0
2019-10-10 1.0 1.0 0.0
2019-10-11 1.0 0.0 1.0
2020-02-27 0.0 -1.0 0.0
2020-02-28 0.0 0.0 -1.0
2020-04-24 1.0 1.0 0.0
2020-04-27 1.0 0.0 1.0
List the signal change and entry/exit points for SMA_028_SlowMA_50_FastMA_10
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-09 1087.99 1081.65 1059.355 1059.2594 0.0956
2019-01-10 1074.94 1078.83 1062.453 1059.1610 3.2920
2019-05-09 1162.60 1167.97 1201.303 1201.9648 -0.6618
2019-05-10 1168.84 1167.64 1190.325 1202.7866 -12.4616
2019-07-12 1142.93 1145.34 1122.246 1120.9344 1.3116
2019-07-15 1145.34 1150.51 1129.017 1120.6144 8.4026
2020-03-02 1351.39 1386.32 1428.193 1429.8206 -1.6276
2020-03-03 1397.68 1337.72 1410.021 1429.5368 -19.5158
2020-04-24 1255.00 1276.60 1254.886 1252.8178 2.0682
2020-04-27 1292.00 1270.86 1260.931 1247.9672 12.9638
trade_signal signal_change entry_exit
date
2019-01-09 1.0 1.0 0.0
2019-01-10 1.0 0.0 1.0
2019-05-09 0.0 -1.0 0.0
2019-05-10 0.0 0.0 -1.0
2019-07-12 1.0 1.0 0.0
2019-07-15 1.0 0.0 1.0
2020-03-02 0.0 -1.0 0.0
2020-03-03 0.0 0.0 -1.0
2020-04-24 1.0 1.0 0.0
2020-04-27 1.0 0.0 1.0
List the signal change and entry/exit points for SMA_029_SlowMA_50_FastMA_15
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-16 1090.00 1089.51 1064.292000 1059.7850 4.507000
2019-01-17 1087.99 1099.12 1067.710000 1060.3376 7.372400
2019-05-14 1142.32 1124.86 1197.967333 1201.9768 -4.009467
2019-05-15 1122.55 1170.80 1192.017333 1202.0090 -9.991667
2019-07-17 1150.92 1146.74 1122.008000 1118.9582 3.049800
2019-07-18 1142.00 1147.24 1126.469333 1118.3258 8.143533
2020-03-05 1345.55 1314.76 1423.208667 1429.3108 -6.102133
2020-03-06 1269.95 1295.74 1408.698667 1428.2130 -19.514333
2020-04-28 1283.20 1232.59 1243.229333 1242.2444 0.984933
2020-04-29 1345.00 1342.18 1253.870667 1238.6992 15.171467
trade_signal signal_change entry_exit
date
2019-01-16 1.0 1.0 0.0
2019-01-17 1.0 0.0 1.0
2019-05-14 0.0 -1.0 0.0
2019-05-15 0.0 0.0 -1.0
2019-07-17 1.0 1.0 0.0
2019-07-18 1.0 0.0 1.0
2020-03-05 0.0 -1.0 0.0
2020-03-06 0.0 0.0 -1.0
2020-04-28 1.0 1.0 0.0
2020-04-29 1.0 0.0 1.0
List the signal change and entry/exit points for SMA_030_SlowMA_50_FastMA_20
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-23 1086.86 1084.41 1065.9255 1061.0736 4.8519
2019-01-24 1082.51 1084.00 1070.8920 1060.8610 10.0310
2019-05-17 1175.83 1168.78 1200.8970 1202.7588 -1.8618
2019-05-20 1153.00 1144.66 1195.4420 1202.6526 -7.2106
2019-07-18 1142.00 1147.24 1121.0105 1118.3258 2.6847
2019-07-19 1149.32 1131.55 1121.9280 1117.5412 4.3868
2020-03-09 1204.96 1215.79 1419.8505 1425.6402 -5.7897
2020-03-10 1254.39 1275.17 1408.1760 1423.8942 -15.7182
2020-04-30 1331.36 1346.70 1236.5120 1235.1358 1.3762
2020-05-01 1324.09 1317.32 1246.5265 1231.1424 15.3841
trade_signal signal_change entry_exit
date
2019-01-23 1.0 1.0 0.0
2019-01-24 1.0 0.0 1.0
2019-05-17 0.0 -1.0 0.0
2019-05-20 0.0 0.0 -1.0
2019-07-18 1.0 1.0 0.0
2019-07-19 1.0 0.0 1.0
2020-03-09 0.0 -1.0 0.0
2020-03-10 0.0 0.0 -1.0
2020-04-30 1.0 1.0 0.0
2020-05-01 1.0 0.0 1.0
if verbose:
for key in model_collection:
graph_data = model_collection[key].copy()
title_string = "Simple Moving Average Crossover Model for " + key
fig = plt.figure(figsize=(16,9))
ylabel = stock_symbol + ' price in $'
ax1 = fig.add_subplot(111, ylabel=ylabel, title=title_string)
graph_data['fast_ma'].plot(ax=ax1, color='b', lw=2.)
graph_data['slow_ma'].plot(ax=ax1, color='r', lw=2.)
graph_data['close_price'].plot(ax=ax1, color='g')
ax1.plot(graph_data.loc[graph_data.entry_exit == 1].index, graph_data.close_price[graph_data.entry_exit == 1], '^', markersize=7, color='k',label='buy')
ax1.plot(graph_data.loc[graph_data.entry_exit == -1].index, graph_data.close_price[graph_data.entry_exit == -1], 'v', markersize=7, color='k',label='sell')
plt.legend(loc='upper left')
plt.show()
def trading_portfolio_generation(initial_fund, trading_model):
# Construct a portfolio to track the transactions and returns
portfolio = pd.DataFrame(index=trading_model.index, columns=['trade_action', 'qty_onhand', 'cost_basis', 'sold_transaction', 'gain_loss', 'cash_onhand', 'position_value', 'total_position', 'accumu_return'])
portfolio.iloc[0]['trade_action'] = 0
portfolio.iloc[0]['qty_onhand'] = 0
portfolio.iloc[0]['cost_basis'] = 0.00
portfolio.iloc[0]['sold_transaction'] = 0.00
portfolio.iloc[0]['gain_loss'] = 0.00
portfolio.iloc[0]['cash_onhand'] = initial_capital
portfolio.iloc[0]['position_value'] = 0.00
portfolio.iloc[0]['total_position'] = initial_capital
portfolio.iloc[0]['accumu_return'] = portfolio.iloc[0]['total_position'] - initial_fund
recent_cost = 0
# The conditional parameters below determine how the trading strategy will be carried out
for i in range(1, len(portfolio)):
if (trading_model.iloc[i]['entry_exit'] == 1) and (portfolio.iloc[i-1]['qty_onhand'] == 0):
portfolio.iloc[i]['trade_action'] = 1
portfolio.iloc[i]['qty_onhand'] = portfolio.iloc[i-1]['qty_onhand'] + portfolio.iloc[i]['trade_action']
portfolio.iloc[i]['cost_basis'] = trading_model.iloc[i]['open_price'] * portfolio.iloc[i]['trade_action']
portfolio.iloc[i]['sold_transaction'] = 0.00
portfolio.iloc[i]['gain_loss'] = 0.00
portfolio.iloc[i]['cash_onhand'] = portfolio.iloc[i-1]['cash_onhand'] - portfolio.iloc[i]['cost_basis']
recent_cost = trading_model.iloc[i]['open_price'] * portfolio.iloc[i]['trade_action']
if verbose: print('BOUGHT QTY:', portfolio.iloc[i]['trade_action'], 'on', portfolio.index[i], 'at the price of', trading_model.iloc[i]['open_price'])
elif (trading_model.iloc[i]['entry_exit'] == -1) and (portfolio.iloc[i-1]['qty_onhand'] > 0):
portfolio.iloc[i]['trade_action'] = -1
portfolio.iloc[i]['qty_onhand'] = portfolio.iloc[i-1]['qty_onhand'] + portfolio.iloc[i]['trade_action']
portfolio.iloc[i]['cost_basis'] = 0.00
portfolio.iloc[i]['sold_transaction'] = trading_model.iloc[i]['open_price'] * portfolio.iloc[i]['trade_action'] * -1
portfolio.iloc[i]['gain_loss'] = (recent_cost + (trading_model.iloc[i]['open_price'] * portfolio.iloc[i]['trade_action'])) * -1
portfolio.iloc[i]['cash_onhand'] = portfolio.iloc[i-1]['cash_onhand'] + portfolio.iloc[i]['sold_transaction']
recent_cost = 0.00
if verbose: print('SOLD QTY:', portfolio.iloc[i]['trade_action'], 'on', portfolio.index[i], 'at the price of', trading_model.iloc[i]['open_price'])
else:
portfolio.iloc[i]['trade_action'] = 0
portfolio.iloc[i]['qty_onhand'] = portfolio.iloc[i-1]['qty_onhand']
portfolio.iloc[i]['cost_basis'] = portfolio.iloc[i-1]['cost_basis']
portfolio.iloc[i]['sold_transaction'] = 0.00
portfolio.iloc[i]['gain_loss'] = 0.00
portfolio.iloc[i]['cash_onhand'] = portfolio.iloc[i-1]['cash_onhand']
portfolio.iloc[i]['position_value'] = trading_model.iloc[i]['close_price'] * portfolio.iloc[i]['qty_onhand']
portfolio.iloc[i]['total_position'] = portfolio.iloc[i]['cash_onhand'] + portfolio.iloc[i]['position_value']
portfolio.iloc[i]['accumu_return'] = portfolio.iloc[i]['total_position'] - initial_fund
return portfolio
portfolio_collection = {}
# Build dataframe for reporting model performance summary
performance_summary = pd.DataFrame(columns=['model_name','return_value','return_percent'])
for key in model_collection:
print('Processing portfolio for model:', key)
portfolio_collection[key] = trading_portfolio_generation(initial_capital, model_collection[key])
trade_transactions = portfolio_collection[key][portfolio_collection[key].trade_action != 0]
print(trade_transactions)
print('Accumulated profit/loss for one share of stock with initial capital of $%.0f at the end of modeling period: $%.2f' % (initial_capital, portfolio_collection[key].accumu_return[-1]))
if initial_capital != 0:
return_percentage = portfolio_collection[key].accumu_return[-1] / initial_capital * 100
print('Accumulated return percentage based on the initial capital investment: %.2f%%' % (return_percentage))
else:
return_percentage = None
if trade_transactions.iloc[-1]['trade_action'] == 1:
print('The current status of the model is:', 'Holding a position since', trade_transactions.index.tolist()[-1], '\n')
else:
print('The current status of the model is:', 'Waiting to enter since', trade_transactions.index.tolist()[-1], '\n')
performance_summary = performance_summary.append({'model_name': key, 'return_value': portfolio_collection[key].accumu_return[-1],
'return_percent': return_percentage}, ignore_index=True)
Processing portfolio for model: SMA_001_SlowMA_10_FastMA_05
BOUGHT QTY: 1 on 2019-01-22 00:00:00 at the price of 1096.0
SOLD QTY: -1 on 2019-01-29 00:00:00 at the price of 1081.04
BOUGHT QTY: 1 on 2019-02-01 00:00:00 at the price of 1122.29
SOLD QTY: -1 on 2019-02-13 00:00:00 at the price of 1133.04
BOUGHT QTY: 1 on 2019-02-20 00:00:00 at the price of 1128.88
SOLD QTY: -1 on 2019-02-25 00:00:00 at the price of 1121.93
BOUGHT QTY: 1 on 2019-03-01 00:00:00 at the price of 1131.0
SOLD QTY: -1 on 2019-03-29 00:00:00 at the price of 1180.18
BOUGHT QTY: 1 on 2019-04-05 00:00:00 at the price of 1219.3
SOLD QTY: -1 on 2019-05-02 00:00:00 at the price of 1172.6
BOUGHT QTY: 1 on 2019-05-22 00:00:00 at the price of 1151.25
SOLD QTY: -1 on 2019-05-24 00:00:00 at the price of 1152.0
BOUGHT QTY: 1 on 2019-06-14 00:00:00 at the price of 1089.74
SOLD QTY: -1 on 2019-06-28 00:00:00 at the price of 1077.23
BOUGHT QTY: 1 on 2019-07-08 00:00:00 at the price of 1125.87
SOLD QTY: -1 on 2019-07-24 00:00:00 at the price of 1132.62
BOUGHT QTY: 1 on 2019-07-29 00:00:00 at the price of 1242.5
SOLD QTY: -1 on 2019-08-07 00:00:00 at the price of 1157.8
BOUGHT QTY: 1 on 2019-08-15 00:00:00 at the price of 1168.43
SOLD QTY: -1 on 2019-08-16 00:00:00 at the price of 1180.79
BOUGHT QTY: 1 on 2019-08-23 00:00:00 at the price of 1185.17
SOLD QTY: -1 on 2019-08-27 00:00:00 at the price of 1183.0
BOUGHT QTY: 1 on 2019-09-04 00:00:00 at the price of 1179.45
SOLD QTY: -1 on 2019-09-25 00:00:00 at the price of 1216.01
BOUGHT QTY: 1 on 2019-09-30 00:00:00 at the price of 1220.6
SOLD QTY: -1 on 2019-10-01 00:00:00 at the price of 1222.49
BOUGHT QTY: 1 on 2019-10-11 00:00:00 at the price of 1224.03
SOLD QTY: -1 on 2019-11-25 00:00:00 at the price of 1296.26
BOUGHT QTY: 1 on 2019-12-05 00:00:00 at the price of 1327.0
SOLD QTY: -1 on 2019-12-26 00:00:00 at the price of 1346.55
BOUGHT QTY: 1 on 2019-12-27 00:00:00 at the price of 1364.0
SOLD QTY: -1 on 2019-12-30 00:00:00 at the price of 1356.81
BOUGHT QTY: 1 on 2020-01-03 00:00:00 at the price of 1348.0
SOLD QTY: -1 on 2020-01-06 00:00:00 at the price of 1351.63
BOUGHT QTY: 1 on 2020-01-07 00:00:00 at the price of 1400.46
SOLD QTY: -1 on 2020-01-30 00:00:00 at the price of 1438.1
BOUGHT QTY: 1 on 2020-02-07 00:00:00 at the price of 1467.38
SOLD QTY: -1 on 2020-02-25 00:00:00 at the price of 1431.0
BOUGHT QTY: 1 on 2020-03-30 00:00:00 at the price of 1132.64
SOLD QTY: -1 on 2020-04-08 00:00:00 at the price of 1203.1
BOUGHT QTY: 1 on 2020-04-09 00:00:00 at the price of 1218.18
SOLD QTY: -1 on 2020-04-28 00:00:00 at the price of 1283.2
BOUGHT QTY: 1 on 2020-04-29 00:00:00 at the price of 1345.0
SOLD QTY: -1 on 2020-05-19 00:00:00 at the price of 1385.48
BOUGHT QTY: 1 on 2020-05-21 00:00:00 at the price of 1410.99
SOLD QTY: -1 on 2020-06-16 00:00:00 at the price of 1449.0
BOUGHT QTY: 1 on 2020-06-23 00:00:00 at the price of 1452.0
SOLD QTY: -1 on 2020-06-29 00:00:00 at the price of 1360.34
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-22 1 1 1096 0 0
2019-01-29 -1 0 0 1081.04 -14.96
2019-02-01 1 1 1122.29 0 0
2019-02-13 -1 0 0 1133.04 10.75
2019-02-20 1 1 1128.88 0 0
2019-02-25 -1 0 0 1121.93 -6.95
2019-03-01 1 1 1131 0 0
2019-03-29 -1 0 0 1180.18 49.18
2019-04-05 1 1 1219.3 0 0
2019-05-02 -1 0 0 1172.6 -46.7
2019-05-22 1 1 1151.25 0 0
2019-05-24 -1 0 0 1152 0.75
2019-06-14 1 1 1089.74 0 0
2019-06-28 -1 0 0 1077.23 -12.51
2019-07-08 1 1 1125.87 0 0
2019-07-24 -1 0 0 1132.62 6.75
2019-07-29 1 1 1242.5 0 0
2019-08-07 -1 0 0 1157.8 -84.7
2019-08-15 1 1 1168.43 0 0
2019-08-16 -1 0 0 1180.79 12.36
2019-08-23 1 1 1185.17 0 0
2019-08-27 -1 0 0 1183 -2.17
2019-09-04 1 1 1179.45 0 0
2019-09-25 -1 0 0 1216.01 36.56
2019-09-30 1 1 1220.6 0 0
2019-10-01 -1 0 0 1222.49 1.89
2019-10-11 1 1 1224.03 0 0
2019-11-25 -1 0 0 1296.26 72.23
2019-12-05 1 1 1327 0 0
2019-12-26 -1 0 0 1346.55 19.55
2019-12-27 1 1 1364 0 0
2019-12-30 -1 0 0 1356.81 -7.19
2020-01-03 1 1 1348 0 0
2020-01-06 -1 0 0 1351.63 3.63
2020-01-07 1 1 1400.46 0 0
2020-01-30 -1 0 0 1438.1 37.64
2020-02-07 1 1 1467.38 0 0
2020-02-25 -1 0 0 1431 -36.38
2020-03-30 1 1 1132.64 0 0
2020-04-08 -1 0 0 1203.1 70.46
2020-04-09 1 1 1218.18 0 0
2020-04-28 -1 0 0 1283.2 65.02
2020-04-29 1 1 1345 0 0
2020-05-19 -1 0 0 1385.48 40.48
2020-05-21 1 1 1410.99 0 0
2020-06-16 -1 0 0 1449 38.01
2020-06-23 1 1 1452 0 0
2020-06-29 -1 0 0 1360.34 -91.66
cash_onhand position_value total_position accumu_return
date
2019-01-22 -1096 1078.63 -17.37 -17.37
2019-01-29 -14.96 0 -14.96 -14.96
2019-02-01 -1137.25 1118.62 -18.63 -18.63
2019-02-13 -4.21 0 -4.21 -4.21
2019-02-20 -1133.09 1120.59 -12.5 -12.5
2019-02-25 -11.16 0 -11.16 -11.16
2019-03-01 -1142.16 1148.52 6.36 6.36
2019-03-29 38.02 0 38.02 38.02
2019-04-05 -1181.28 1211.45 30.17 30.17
2019-05-02 -8.68 0 -8.68 -8.68
2019-05-22 -1159.93 1155.85 -4.08 -4.08
2019-05-24 -7.93 0 -7.93 -7.93
2019-06-14 -1097.67 1086.3 -11.37 -11.37
2019-06-28 -20.44 0 -20.44 -20.44
2019-07-08 -1146.31 1116.79 -29.52 -29.52
2019-07-24 -13.69 0 -13.69 -13.69
2019-07-29 -1256.19 1241.84 -14.35 -14.35
2019-08-07 -98.39 0 -98.39 -98.39
2019-08-15 -1266.82 1169.32 -97.5 -97.5
2019-08-16 -86.03 0 -86.03 -86.03
2019-08-23 -1271.2 1153.58 -117.62 -117.62
2019-08-27 -88.2 0 -88.2 -88.2
2019-09-04 -1267.65 1182.27 -85.38 -85.38
2019-09-25 -51.64 0 -51.64 -51.64
2019-09-30 -1272.24 1221.14 -51.1 -51.1
2019-10-01 -49.75 0 -49.75 -49.75
2019-10-11 -1273.78 1215.71 -58.07 -58.07
2019-11-25 22.48 0 22.48 22.48
2019-12-05 -1304.52 1326.96 22.44 22.44
2019-12-26 42.03 0 42.03 42.03
2019-12-27 -1321.97 1354.64 32.67 32.67
2019-12-30 34.84 0 34.84 34.84
2020-01-03 -1313.16 1361.52 48.36 48.36
2020-01-06 38.47 0 38.47 38.47
2020-01-07 -1361.99 1395.11 33.12 33.12
2020-01-30 76.11 0 76.11 76.11
2020-02-07 -1391.27 1479.11 87.84 87.84
2020-02-25 39.73 0 39.73 39.73
2020-03-30 -1092.91 1146.31 53.4 53.4
2020-04-08 110.19 0 110.19 110.19
2020-04-09 -1107.99 1206.57 98.58 98.58
2020-04-28 175.21 0 175.21 175.21
2020-04-29 -1169.79 1342.18 172.39 172.39
2020-05-19 215.69 0 215.69 215.69
2020-05-21 -1195.3 1406.75 211.45 211.45
2020-06-16 253.7 0 253.7 253.7
2020-06-23 -1198.3 1463.98 265.68 265.68
2020-06-29 162.04 0 162.04 162.04
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $162.04
The current status of the model is: Waiting to enter since 2020-06-29 00:00:00
Processing portfolio for model: SMA_002_SlowMA_15_FastMA_05
BOUGHT QTY: 1 on 2019-03-01 00:00:00 at the price of 1131.0
SOLD QTY: -1 on 2019-03-29 00:00:00 at the price of 1180.18
BOUGHT QTY: 1 on 2019-04-05 00:00:00 at the price of 1219.3
SOLD QTY: -1 on 2019-05-03 00:00:00 at the price of 1177.41
BOUGHT QTY: 1 on 2019-06-18 00:00:00 at the price of 1111.5
SOLD QTY: -1 on 2019-07-01 00:00:00 at the price of 1101.04
BOUGHT QTY: 1 on 2019-07-08 00:00:00 at the price of 1125.87
SOLD QTY: -1 on 2019-07-26 00:00:00 at the price of 1228.0
BOUGHT QTY: 1 on 2019-07-29 00:00:00 at the price of 1242.5
SOLD QTY: -1 on 2019-08-09 00:00:00 at the price of 1199.99
BOUGHT QTY: 1 on 2019-08-22 00:00:00 at the price of 1193.8
SOLD QTY: -1 on 2019-08-27 00:00:00 at the price of 1183.0
BOUGHT QTY: 1 on 2019-09-05 00:00:00 at the price of 1193.66
SOLD QTY: -1 on 2019-10-02 00:00:00 at the price of 1196.5
BOUGHT QTY: 1 on 2019-10-16 00:00:00 at the price of 1241.81
SOLD QTY: -1 on 2019-11-26 00:00:00 at the price of 1309.91
BOUGHT QTY: 1 on 2019-12-09 00:00:00 at the price of 1338.86
SOLD QTY: -1 on 2020-01-02 00:00:00 at the price of 1348.41
BOUGHT QTY: 1 on 2020-01-03 00:00:00 at the price of 1348.0
SOLD QTY: -1 on 2020-01-06 00:00:00 at the price of 1351.63
BOUGHT QTY: 1 on 2020-01-07 00:00:00 at the price of 1400.46
SOLD QTY: -1 on 2020-01-31 00:00:00 at the price of 1467.86
BOUGHT QTY: 1 on 2020-02-10 00:00:00 at the price of 1477.23
SOLD QTY: -1 on 2020-02-26 00:00:00 at the price of 1394.98
BOUGHT QTY: 1 on 2020-04-01 00:00:00 at the price of 1124.0
SOLD QTY: -1 on 2020-06-16 00:00:00 at the price of 1449.0
BOUGHT QTY: 1 on 2020-06-22 00:00:00 at the price of 1425.01
SOLD QTY: -1 on 2020-06-29 00:00:00 at the price of 1360.34
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-03-01 1 1 1131 0 0
2019-03-29 -1 0 0 1180.18 49.18
2019-04-05 1 1 1219.3 0 0
2019-05-03 -1 0 0 1177.41 -41.89
2019-06-18 1 1 1111.5 0 0
2019-07-01 -1 0 0 1101.04 -10.46
2019-07-08 1 1 1125.87 0 0
2019-07-26 -1 0 0 1228 102.13
2019-07-29 1 1 1242.5 0 0
2019-08-09 -1 0 0 1199.99 -42.51
2019-08-22 1 1 1193.8 0 0
2019-08-27 -1 0 0 1183 -10.8
2019-09-05 1 1 1193.66 0 0
2019-10-02 -1 0 0 1196.5 2.84
2019-10-16 1 1 1241.81 0 0
2019-11-26 -1 0 0 1309.91 68.1
2019-12-09 1 1 1338.86 0 0
2020-01-02 -1 0 0 1348.41 9.55
2020-01-03 1 1 1348 0 0
2020-01-06 -1 0 0 1351.63 3.63
2020-01-07 1 1 1400.46 0 0
2020-01-31 -1 0 0 1467.86 67.4
2020-02-10 1 1 1477.23 0 0
2020-02-26 -1 0 0 1394.98 -82.25
2020-04-01 1 1 1124 0 0
2020-06-16 -1 0 0 1449 325
2020-06-22 1 1 1425.01 0 0
2020-06-29 -1 0 0 1360.34 -64.67
cash_onhand position_value total_position accumu_return
date
2019-03-01 -1131 1148.52 17.52 17.52
2019-03-29 49.18 0 49.18 49.18
2019-04-05 -1170.12 1211.45 41.33 41.33
2019-05-03 7.29 0 7.29 7.29
2019-06-18 -1104.21 1105.24 1.03 1.03
2019-07-01 -3.17 0 -3.17 -3.17
2019-07-08 -1129.04 1116.79 -12.25 -12.25
2019-07-26 98.96 0 98.96 98.96
2019-07-29 -1143.54 1241.84 98.3 98.3
2019-08-09 56.45 0 56.45 56.45
2019-08-22 -1137.35 1191.52 54.17 54.17
2019-08-27 45.65 0 45.65 45.65
2019-09-05 -1148.01 1212.19 64.18 64.18
2019-10-02 48.49 0 48.49 48.49
2019-10-16 -1193.32 1243 49.68 49.68
2019-11-26 116.59 0 116.59 116.59
2019-12-09 -1222.27 1342.99 120.72 120.72
2020-01-02 126.14 0 126.14 126.14
2020-01-03 -1221.86 1361.52 139.66 139.66
2020-01-06 129.77 0 129.77 129.77
2020-01-07 -1270.69 1395.11 124.42 124.42
2020-01-31 197.17 0 197.17 197.17
2020-02-10 -1280.06 1508.66 228.6 228.6
2020-02-26 114.92 0 114.92 114.92
2020-04-01 -1009.08 1102.1 93.02 93.02
2020-06-16 439.92 0 439.92 439.92
2020-06-22 -985.09 1450.66 465.57 465.57
2020-06-29 375.25 0 375.25 375.25
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $375.25
The current status of the model is: Waiting to enter since 2020-06-29 00:00:00
Processing portfolio for model: SMA_003_SlowMA_15_FastMA_10
BOUGHT QTY: 1 on 2019-01-08 00:00:00 at the price of 1086.0
SOLD QTY: -1 on 2019-02-21 00:00:00 at the price of 1118.78
BOUGHT QTY: 1 on 2019-02-27 00:00:00 at the price of 1114.01
SOLD QTY: -1 on 2019-04-04 00:00:00 at the price of 1211.29
BOUGHT QTY: 1 on 2019-04-12 00:00:00 at the price of 1215.62
SOLD QTY: -1 on 2019-05-07 00:00:00 at the price of 1185.81
BOUGHT QTY: 1 on 2019-06-20 00:00:00 at the price of 1121.7
SOLD QTY: -1 on 2019-07-09 00:00:00 at the price of 1110.32
BOUGHT QTY: 1 on 2019-07-12 00:00:00 at the price of 1142.93
SOLD QTY: -1 on 2019-08-14 00:00:00 at the price of 1176.07
BOUGHT QTY: 1 on 2019-08-22 00:00:00 at the price of 1193.8
SOLD QTY: -1 on 2019-08-27 00:00:00 at the price of 1183.0
BOUGHT QTY: 1 on 2019-08-30 00:00:00 at the price of 1200.35
SOLD QTY: -1 on 2019-09-04 00:00:00 at the price of 1179.45
BOUGHT QTY: 1 on 2019-09-10 00:00:00 at the price of 1196.09
SOLD QTY: -1 on 2019-10-02 00:00:00 at the price of 1196.5
BOUGHT QTY: 1 on 2019-10-18 00:00:00 at the price of 1254.69
SOLD QTY: -1 on 2019-12-03 00:00:00 at the price of 1278.66
BOUGHT QTY: 1 on 2019-12-10 00:00:00 at the price of 1339.94
SOLD QTY: -1 on 2020-02-06 00:00:00 at the price of 1451.98
BOUGHT QTY: 1 on 2020-02-12 00:00:00 at the price of 1515.86
SOLD QTY: -1 on 2020-02-27 00:00:00 at the price of 1359.14
BOUGHT QTY: 1 on 2020-04-06 00:00:00 at the price of 1133.0
SOLD QTY: -1 on 2020-06-23 00:00:00 at the price of 1452.0
BOUGHT QTY: 1 on 2020-06-30 00:00:00 at the price of 1396.88
SOLD QTY: -1 on 2020-07-01 00:00:00 at the price of 1419.17
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-08 1 1 1086 0 0
2019-02-21 -1 0 0 1118.78 32.78
2019-02-27 1 1 1114.01 0 0
2019-04-04 -1 0 0 1211.29 97.28
2019-04-12 1 1 1215.62 0 0
2019-05-07 -1 0 0 1185.81 -29.81
2019-06-20 1 1 1121.7 0 0
2019-07-09 -1 0 0 1110.32 -11.38
2019-07-12 1 1 1142.93 0 0
2019-08-14 -1 0 0 1176.07 33.14
2019-08-22 1 1 1193.8 0 0
2019-08-27 -1 0 0 1183 -10.8
2019-08-30 1 1 1200.35 0 0
2019-09-04 -1 0 0 1179.45 -20.9
2019-09-10 1 1 1196.09 0 0
2019-10-02 -1 0 0 1196.5 0.41
2019-10-18 1 1 1254.69 0 0
2019-12-03 -1 0 0 1278.66 23.97
2019-12-10 1 1 1339.94 0 0
2020-02-06 -1 0 0 1451.98 112.04
2020-02-12 1 1 1515.86 0 0
2020-02-27 -1 0 0 1359.14 -156.72
2020-04-06 1 1 1133 0 0
2020-06-23 -1 0 0 1452 319
2020-06-30 1 1 1396.88 0 0
2020-07-01 -1 0 0 1419.17 22.29
cash_onhand position_value total_position accumu_return
date
2019-01-08 -1086 1085.37 -0.63 -0.63
2019-02-21 32.78 0 32.78 32.78
2019-02-27 -1081.23 1122.89 41.66 41.66
2019-04-04 130.06 0 130.06 130.06
2019-04-12 -1085.56 1222.73 137.17 137.17
2019-05-07 100.25 0 100.25 100.25
2019-06-20 -1021.45 1113.2 91.75 91.75
2019-07-09 88.87 0 88.87 88.87
2019-07-12 -1054.06 1145.34 91.28 91.28
2019-08-14 122.01 0 122.01 122.01
2019-08-22 -1071.79 1191.52 119.73 119.73
2019-08-27 111.21 0 111.21 111.21
2019-08-30 -1089.14 1190.53 101.39 101.39
2019-09-04 90.31 0 90.31 90.31
2019-09-10 -1105.78 1205.7 99.92 99.92
2019-10-02 90.72 0 90.72 90.72
2019-10-18 -1163.97 1244.41 80.44 80.44
2019-12-03 114.69 0 114.69 114.69
2019-12-10 -1225.25 1342.89 117.64 117.64
2020-02-06 226.73 0 226.73 226.73
2020-02-12 -1289.13 1518.63 229.5 229.5
2020-02-27 70.01 0 70.01 70.01
2020-04-06 -1062.99 1183.19 120.2 120.2
2020-06-23 389.01 0 389.01 389.01
2020-06-30 -1007.87 1418.05 410.18 410.18
2020-07-01 411.3 0 411.3 411.3
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $411.30
The current status of the model is: Waiting to enter since 2020-07-01 00:00:00
Processing portfolio for model: SMA_004_SlowMA_20_FastMA_05
BOUGHT QTY: 1 on 2019-03-04 00:00:00 at the price of 1154.56
SOLD QTY: -1 on 2019-04-01 00:00:00 at the price of 1187.54
BOUGHT QTY: 1 on 2019-04-04 00:00:00 at the price of 1211.29
SOLD QTY: -1 on 2019-05-03 00:00:00 at the price of 1177.41
BOUGHT QTY: 1 on 2019-06-20 00:00:00 at the price of 1121.7
SOLD QTY: -1 on 2019-07-02 00:00:00 at the price of 1104.83
BOUGHT QTY: 1 on 2019-07-03 00:00:00 at the price of 1118.5
SOLD QTY: -1 on 2019-08-16 00:00:00 at the price of 1180.79
BOUGHT QTY: 1 on 2019-09-03 00:00:00 at the price of 1181.85
SOLD QTY: -1 on 2019-09-04 00:00:00 at the price of 1179.45
BOUGHT QTY: 1 on 2019-09-05 00:00:00 at the price of 1193.66
SOLD QTY: -1 on 2019-10-03 00:00:00 at the price of 1183.34
BOUGHT QTY: 1 on 2019-10-17 00:00:00 at the price of 1251.4
SOLD QTY: -1 on 2019-12-04 00:00:00 at the price of 1306.1
BOUGHT QTY: 1 on 2019-12-09 00:00:00 at the price of 1338.86
SOLD QTY: -1 on 2020-02-26 00:00:00 at the price of 1394.98
BOUGHT QTY: 1 on 2020-04-08 00:00:00 at the price of 1203.1
SOLD QTY: -1 on 2020-06-18 00:00:00 at the price of 1449.85
BOUGHT QTY: 1 on 2020-06-19 00:00:00 at the price of 1440.0
SOLD QTY: -1 on 2020-06-29 00:00:00 at the price of 1360.34
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-03-04 1 1 1154.56 0 0
2019-04-01 -1 0 0 1187.54 32.98
2019-04-04 1 1 1211.29 0 0
2019-05-03 -1 0 0 1177.41 -33.88
2019-06-20 1 1 1121.7 0 0
2019-07-02 -1 0 0 1104.83 -16.87
2019-07-03 1 1 1118.5 0 0
2019-08-16 -1 0 0 1180.79 62.29
2019-09-03 1 1 1181.85 0 0
2019-09-04 -1 0 0 1179.45 -2.4
2019-09-05 1 1 1193.66 0 0
2019-10-03 -1 0 0 1183.34 -10.32
2019-10-17 1 1 1251.4 0 0
2019-12-04 -1 0 0 1306.1 54.7
2019-12-09 1 1 1338.86 0 0
2020-02-26 -1 0 0 1394.98 56.12
2020-04-08 1 1 1203.1 0 0
2020-06-18 -1 0 0 1449.85 246.75
2020-06-19 1 1 1440 0 0
2020-06-29 -1 0 0 1360.34 -79.66
cash_onhand position_value total_position accumu_return
date
2019-03-04 -1154.56 1153.42 -1.14 -1.14
2019-04-01 32.98 0 32.98 32.98
2019-04-04 -1178.31 1219.45 41.14 41.14
2019-05-03 -0.9 0 -0.9 -0.9
2019-06-20 -1122.6 1113.2 -9.4 -9.4
2019-07-02 -17.77 0 -17.77 -17.77
2019-07-03 -1136.27 1122.99 -13.28 -13.28
2019-08-16 44.52 0 44.52 44.52
2019-09-03 -1137.33 1169.55 32.22 32.22
2019-09-04 42.12 0 42.12 42.12
2019-09-05 -1151.54 1212.19 60.65 60.65
2019-10-03 31.8 0 31.8 31.8
2019-10-17 -1219.6 1252.8 33.2 33.2
2019-12-04 86.5 0 86.5 86.5
2019-12-09 -1252.36 1342.99 90.63 90.63
2020-02-26 142.62 0 142.62 142.62
2020-04-08 -1060.48 1207 146.52 146.52
2020-06-18 389.37 0 389.37 389.37
2020-06-19 -1050.63 1424.64 374.01 374.01
2020-06-29 309.71 0 309.71 309.71
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $309.71
The current status of the model is: Waiting to enter since 2020-06-29 00:00:00
Processing portfolio for model: SMA_005_SlowMA_20_FastMA_10
BOUGHT QTY: 1 on 2019-01-09 00:00:00 at the price of 1087.99
SOLD QTY: -1 on 2019-03-01 00:00:00 at the price of 1131.0
BOUGHT QTY: 1 on 2019-03-05 00:00:00 at the price of 1156.0
SOLD QTY: -1 on 2019-04-05 00:00:00 at the price of 1219.3
BOUGHT QTY: 1 on 2019-04-11 00:00:00 at the price of 1208.9
SOLD QTY: -1 on 2019-05-08 00:00:00 at the price of 1177.29
BOUGHT QTY: 1 on 2019-06-24 00:00:00 at the price of 1120.0
SOLD QTY: -1 on 2019-08-16 00:00:00 at the price of 1180.79
BOUGHT QTY: 1 on 2019-08-30 00:00:00 at the price of 1200.35
SOLD QTY: -1 on 2019-09-04 00:00:00 at the price of 1179.45
BOUGHT QTY: 1 on 2019-09-10 00:00:00 at the price of 1196.09
SOLD QTY: -1 on 2019-10-04 00:00:00 at the price of 1194.29
BOUGHT QTY: 1 on 2019-10-18 00:00:00 at the price of 1254.69
SOLD QTY: -1 on 2019-12-04 00:00:00 at the price of 1306.1
BOUGHT QTY: 1 on 2019-12-09 00:00:00 at the price of 1338.86
SOLD QTY: -1 on 2020-02-10 00:00:00 at the price of 1477.23
BOUGHT QTY: 1 on 2020-02-11 00:00:00 at the price of 1513.27
SOLD QTY: -1 on 2020-02-28 00:00:00 at the price of 1274.31
BOUGHT QTY: 1 on 2020-04-08 00:00:00 at the price of 1203.1
SOLD QTY: -1 on 2020-06-25 00:00:00 at the price of 1431.22
BOUGHT QTY: 1 on 2020-06-26 00:00:00 at the price of 1432.63
SOLD QTY: -1 on 2020-06-29 00:00:00 at the price of 1360.34
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-09 1 1 1087.99 0 0
2019-03-01 -1 0 0 1131 43.01
2019-03-05 1 1 1156 0 0
2019-04-05 -1 0 0 1219.3 63.3
2019-04-11 1 1 1208.9 0 0
2019-05-08 -1 0 0 1177.29 -31.61
2019-06-24 1 1 1120 0 0
2019-08-16 -1 0 0 1180.79 60.79
2019-08-30 1 1 1200.35 0 0
2019-09-04 -1 0 0 1179.45 -20.9
2019-09-10 1 1 1196.09 0 0
2019-10-04 -1 0 0 1194.29 -1.8
2019-10-18 1 1 1254.69 0 0
2019-12-04 -1 0 0 1306.1 51.41
2019-12-09 1 1 1338.86 0 0
2020-02-10 -1 0 0 1477.23 138.37
2020-02-11 1 1 1513.27 0 0
2020-02-28 -1 0 0 1274.31 -238.96
2020-04-08 1 1 1203.1 0 0
2020-06-25 -1 0 0 1431.22 228.12
2020-06-26 1 1 1432.63 0 0
2020-06-29 -1 0 0 1360.34 -72.29
cash_onhand position_value total_position accumu_return
date
2019-01-09 -1087.99 1081.65 -6.34 -6.34
2019-03-01 43.01 0 43.01 43.01
2019-03-05 -1112.99 1169.19 56.2 56.2
2019-04-05 106.31 0 106.31 106.31
2019-04-11 -1102.59 1209.59 107 107
2019-05-08 74.7 0 74.7 74.7
2019-06-24 -1045.3 1116.7 71.4 71.4
2019-08-16 135.49 0 135.49 135.49
2019-08-30 -1064.86 1190.53 125.67 125.67
2019-09-04 114.59 0 114.59 114.59
2019-09-10 -1081.5 1205.7 124.2 124.2
2019-10-04 112.79 0 112.79 112.79
2019-10-18 -1141.9 1244.41 102.51 102.51
2019-12-04 164.2 0 164.2 164.2
2019-12-09 -1174.66 1342.99 168.33 168.33
2020-02-10 302.57 0 302.57 302.57
2020-02-11 -1210.7 1510.06 299.36 299.36
2020-02-28 63.61 0 63.61 63.61
2020-04-08 -1139.49 1207 67.51 67.51
2020-06-25 291.73 0 291.73 291.73
2020-06-26 -1140.9 1362.54 221.64 221.64
2020-06-29 219.44 0 219.44 219.44
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $219.44
The current status of the model is: Waiting to enter since 2020-06-29 00:00:00
Processing portfolio for model: SMA_006_SlowMA_20_FastMA_15
BOUGHT QTY: 1 on 2019-01-14 00:00:00 at the price of 1053.34
SOLD QTY: -1 on 2019-02-28 00:00:00 at the price of 1119.0
BOUGHT QTY: 1 on 2019-03-06 00:00:00 at the price of 1171.76
SOLD QTY: -1 on 2019-04-12 00:00:00 at the price of 1215.62
BOUGHT QTY: 1 on 2019-04-18 00:00:00 at the price of 1245.0
SOLD QTY: -1 on 2019-05-10 00:00:00 at the price of 1168.84
BOUGHT QTY: 1 on 2019-06-26 00:00:00 at the price of 1091.0
SOLD QTY: -1 on 2019-08-21 00:00:00 at the price of 1195.82
BOUGHT QTY: 1 on 2019-09-03 00:00:00 at the price of 1181.85
SOLD QTY: -1 on 2019-09-04 00:00:00 at the price of 1179.45
BOUGHT QTY: 1 on 2019-09-09 00:00:00 at the price of 1207.08
SOLD QTY: -1 on 2019-10-08 00:00:00 at the price of 1198.77
BOUGHT QTY: 1 on 2019-10-24 00:00:00 at the price of 1259.11
SOLD QTY: -1 on 2020-02-14 00:00:00 at the price of 1514.53
BOUGHT QTY: 1 on 2020-02-19 00:00:00 at the price of 1527.2
SOLD QTY: -1 on 2020-03-03 00:00:00 at the price of 1397.68
BOUGHT QTY: 1 on 2020-04-09 00:00:00 at the price of 1218.18
SOLD QTY: -1 on 2020-06-29 00:00:00 at the price of 1360.34
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-14 1 1 1053.34 0 0
2019-02-28 -1 0 0 1119 65.66
2019-03-06 1 1 1171.76 0 0
2019-04-12 -1 0 0 1215.62 43.86
2019-04-18 1 1 1245 0 0
2019-05-10 -1 0 0 1168.84 -76.16
2019-06-26 1 1 1091 0 0
2019-08-21 -1 0 0 1195.82 104.82
2019-09-03 1 1 1181.85 0 0
2019-09-04 -1 0 0 1179.45 -2.4
2019-09-09 1 1 1207.08 0 0
2019-10-08 -1 0 0 1198.77 -8.31
2019-10-24 1 1 1259.11 0 0
2020-02-14 -1 0 0 1514.53 255.42
2020-02-19 1 1 1527.2 0 0
2020-03-03 -1 0 0 1397.68 -129.52
2020-04-09 1 1 1218.18 0 0
2020-06-29 -1 0 0 1360.34 142.16
cash_onhand position_value total_position accumu_return
date
2019-01-14 -1053.34 1051.51 -1.83 -1.83
2019-02-28 65.66 0 65.66 65.66
2019-03-06 -1106.1 1164.94 58.84 58.84
2019-04-12 109.52 0 109.52 109.52
2019-04-18 -1135.48 1241.47 105.99 105.99
2019-05-10 33.36 0 33.36 33.36
2019-06-26 -1057.64 1080.32 22.68 22.68
2019-08-21 138.18 0 138.18 138.18
2019-09-03 -1043.67 1169.55 125.88 125.88
2019-09-04 135.78 0 135.78 135.78
2019-09-09 -1071.3 1205.27 133.97 133.97
2019-10-08 127.47 0 127.47 127.47
2019-10-24 -1131.64 1259.11 127.47 127.47
2020-02-14 382.89 0 382.89 382.89
2020-02-19 -1144.31 1524.87 380.56 380.56
2020-03-03 253.37 0 253.37 253.37
2020-04-09 -964.81 1206.57 241.76 241.76
2020-06-29 395.53 0 395.53 395.53
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $395.53
The current status of the model is: Waiting to enter since 2020-06-29 00:00:00
Processing portfolio for model: SMA_007_SlowMA_25_FastMA_05
BOUGHT QTY: 1 on 2019-01-08 00:00:00 at the price of 1086.0
SOLD QTY: -1 on 2019-05-06 00:00:00 at the price of 1172.0
BOUGHT QTY: 1 on 2019-06-24 00:00:00 at the price of 1120.0
SOLD QTY: -1 on 2019-07-01 00:00:00 at the price of 1101.04
BOUGHT QTY: 1 on 2019-07-03 00:00:00 at the price of 1118.5
SOLD QTY: -1 on 2019-08-21 00:00:00 at the price of 1195.82
BOUGHT QTY: 1 on 2019-08-22 00:00:00 at the price of 1193.8
SOLD QTY: -1 on 2019-08-26 00:00:00 at the price of 1159.45
BOUGHT QTY: 1 on 2019-09-06 00:00:00 at the price of 1209.14
SOLD QTY: -1 on 2019-10-03 00:00:00 at the price of 1183.34
BOUGHT QTY: 1 on 2019-10-17 00:00:00 at the price of 1251.4
SOLD QTY: -1 on 2020-02-26 00:00:00 at the price of 1394.98
BOUGHT QTY: 1 on 2020-04-09 00:00:00 at the price of 1218.18
SOLD QTY: -1 on 2020-06-29 00:00:00 at the price of 1360.34
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-08 1 1 1086 0 0
2019-05-06 -1 0 0 1172 86
2019-06-24 1 1 1120 0 0
2019-07-01 -1 0 0 1101.04 -18.96
2019-07-03 1 1 1118.5 0 0
2019-08-21 -1 0 0 1195.82 77.32
2019-08-22 1 1 1193.8 0 0
2019-08-26 -1 0 0 1159.45 -34.35
2019-09-06 1 1 1209.14 0 0
2019-10-03 -1 0 0 1183.34 -25.8
2019-10-17 1 1 1251.4 0 0
2020-02-26 -1 0 0 1394.98 143.58
2020-04-09 1 1 1218.18 0 0
2020-06-29 -1 0 0 1360.34 142.16
cash_onhand position_value total_position accumu_return
date
2019-01-08 -1086 1085.37 -0.63 -0.63
2019-05-06 86 0 86 86
2019-06-24 -1034 1116.7 82.7 82.7
2019-07-01 67.04 0 67.04 67.04
2019-07-03 -1051.46 1122.99 71.53 71.53
2019-08-21 144.36 0 144.36 144.36
2019-08-22 -1049.44 1191.52 142.08 142.08
2019-08-26 110.01 0 110.01 110.01
2019-09-06 -1099.13 1206.32 107.19 107.19
2019-10-03 84.21 0 84.21 84.21
2019-10-17 -1167.19 1252.8 85.61 85.61
2020-02-26 227.79 0 227.79 227.79
2020-04-09 -990.39 1206.57 216.18 216.18
2020-06-29 369.95 0 369.95 369.95
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $369.95
The current status of the model is: Waiting to enter since 2020-06-29 00:00:00
Processing portfolio for model: SMA_008_SlowMA_25_FastMA_10
BOUGHT QTY: 1 on 2019-01-10 00:00:00 at the price of 1074.94
SOLD QTY: -1 on 2019-05-08 00:00:00 at the price of 1177.29
BOUGHT QTY: 1 on 2019-06-26 00:00:00 at the price of 1091.0
SOLD QTY: -1 on 2019-08-26 00:00:00 at the price of 1159.45
BOUGHT QTY: 1 on 2019-09-10 00:00:00 at the price of 1196.09
SOLD QTY: -1 on 2019-10-08 00:00:00 at the price of 1198.77
BOUGHT QTY: 1 on 2019-10-21 00:00:00 at the price of 1248.7
SOLD QTY: -1 on 2020-02-28 00:00:00 at the price of 1274.31
BOUGHT QTY: 1 on 2020-04-13 00:00:00 at the price of 1201.5
SOLD QTY: -1 on 2020-06-30 00:00:00 at the price of 1396.88
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-10 1 1 1074.94 0 0
2019-05-08 -1 0 0 1177.29 102.35
2019-06-26 1 1 1091 0 0
2019-08-26 -1 0 0 1159.45 68.45
2019-09-10 1 1 1196.09 0 0
2019-10-08 -1 0 0 1198.77 2.68
2019-10-21 1 1 1248.7 0 0
2020-02-28 -1 0 0 1274.31 25.61
2020-04-13 1 1 1201.5 0 0
2020-06-30 -1 0 0 1396.88 195.38
cash_onhand position_value total_position accumu_return
date
2019-01-10 -1074.94 1078.83 3.89 3.89
2019-05-08 102.35 0 102.35 102.35
2019-06-26 -988.65 1080.32 91.67 91.67
2019-08-26 170.8 0 170.8 170.8
2019-09-10 -1025.29 1205.7 180.41 180.41
2019-10-08 173.48 0 173.48 173.48
2019-10-21 -1075.22 1244.28 169.06 169.06
2020-02-28 199.09 0 199.09 199.09
2020-04-13 -1002.41 1210.41 208 208
2020-06-30 394.47 0 394.47 394.47
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $394.47
The current status of the model is: Waiting to enter since 2020-06-30 00:00:00
Processing portfolio for model: SMA_009_SlowMA_25_FastMA_15
BOUGHT QTY: 1 on 2019-01-15 00:00:00 at the price of 1058.01
SOLD QTY: -1 on 2019-04-15 00:00:00 at the price of 1224.09
BOUGHT QTY: 1 on 2019-04-17 00:00:00 at the price of 1237.0
SOLD QTY: -1 on 2019-05-13 00:00:00 at the price of 1145.24
BOUGHT QTY: 1 on 2019-07-01 00:00:00 at the price of 1101.04
SOLD QTY: -1 on 2019-08-23 00:00:00 at the price of 1185.17
BOUGHT QTY: 1 on 2019-09-09 00:00:00 at the price of 1207.08
SOLD QTY: -1 on 2019-10-10 00:00:00 at the price of 1198.6
BOUGHT QTY: 1 on 2019-10-24 00:00:00 at the price of 1259.11
SOLD QTY: -1 on 2020-03-04 00:00:00 at the price of 1358.96
BOUGHT QTY: 1 on 2020-04-15 00:00:00 at the price of 1246.51
SOLD QTY: -1 on 2020-06-30 00:00:00 at the price of 1396.88
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-15 1 1 1058.01 0 0
2019-04-15 -1 0 0 1224.09 166.08
2019-04-17 1 1 1237 0 0
2019-05-13 -1 0 0 1145.24 -91.76
2019-07-01 1 1 1101.04 0 0
2019-08-23 -1 0 0 1185.17 84.13
2019-09-09 1 1 1207.08 0 0
2019-10-10 -1 0 0 1198.6 -8.48
2019-10-24 1 1 1259.11 0 0
2020-03-04 -1 0 0 1358.96 99.85
2020-04-15 1 1 1246.51 0 0
2020-06-30 -1 0 0 1396.88 150.37
cash_onhand position_value total_position accumu_return
date
2019-01-15 -1058.01 1086.51 28.5 28.5
2019-04-15 166.08 0 166.08 166.08
2019-04-17 -1070.92 1240.14 169.22 169.22
2019-05-13 74.32 0 74.32 74.32
2019-07-01 -1026.72 1100 73.28 73.28
2019-08-23 158.45 0 158.45 158.45
2019-09-09 -1048.63 1205.27 156.64 156.64
2019-10-10 149.97 0 149.97 149.97
2019-10-24 -1109.14 1259.11 149.97 149.97
2020-03-04 249.82 0 249.82 249.82
2020-04-15 -996.69 1257.3 260.61 260.61
2020-06-30 400.19 0 400.19 400.19
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $400.19
The current status of the model is: Waiting to enter since 2020-06-30 00:00:00
Processing portfolio for model: SMA_010_SlowMA_25_FastMA_20
BOUGHT QTY: 1 on 2019-01-18 00:00:00 at the price of 1108.59
SOLD QTY: -1 on 2019-03-07 00:00:00 at the price of 1160.5
BOUGHT QTY: 1 on 2019-03-11 00:00:00 at the price of 1152.0
SOLD QTY: -1 on 2019-04-22 00:00:00 at the price of 1236.67
BOUGHT QTY: 1 on 2019-04-25 00:00:00 at the price of 1270.3
SOLD QTY: -1 on 2019-05-15 00:00:00 at the price of 1122.55
BOUGHT QTY: 1 on 2019-07-03 00:00:00 at the price of 1118.5
SOLD QTY: -1 on 2019-08-28 00:00:00 at the price of 1164.87
BOUGHT QTY: 1 on 2019-09-06 00:00:00 at the price of 1209.14
SOLD QTY: -1 on 2019-09-12 00:00:00 at the price of 1223.47
BOUGHT QTY: 1 on 2019-09-13 00:00:00 at the price of 1232.11
SOLD QTY: -1 on 2019-10-14 00:00:00 at the price of 1213.89
BOUGHT QTY: 1 on 2019-10-30 00:00:00 at the price of 1255.15
SOLD QTY: -1 on 2020-03-04 00:00:00 at the price of 1358.96
BOUGHT QTY: 1 on 2020-04-16 00:00:00 at the price of 1267.14
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-18 1 1 1108.59 0 0
2019-03-07 -1 0 0 1160.5 51.91
2019-03-11 1 1 1152 0 0
2019-04-22 -1 0 0 1236.67 84.67
2019-04-25 1 1 1270.3 0 0
2019-05-15 -1 0 0 1122.55 -147.75
2019-07-03 1 1 1118.5 0 0
2019-08-28 -1 0 0 1164.87 46.37
2019-09-06 1 1 1209.14 0 0
2019-09-12 -1 0 0 1223.47 14.33
2019-09-13 1 1 1232.11 0 0
2019-10-14 -1 0 0 1213.89 -18.22
2019-10-30 1 1 1255.15 0 0
2020-03-04 -1 0 0 1358.96 103.81
2020-04-16 1 1 1267.14 0 0
cash_onhand position_value total_position accumu_return
date
2019-01-18 -1108.59 1107.3 -1.29 -1.29
2019-03-07 51.91 0 51.91 51.91
2019-03-11 -1100.09 1179.26 79.17 79.17
2019-04-22 136.58 0 136.58 136.58
2019-04-25 -1133.72 1267.34 133.62 133.62
2019-05-15 -11.17 0 -11.17 -11.17
2019-07-03 -1129.67 1122.99 -6.68 -6.68
2019-08-28 35.2 0 35.2 35.2
2019-09-06 -1173.94 1206.32 32.38 32.38
2019-09-12 49.53 0 49.53 49.53
2019-09-13 -1182.58 1240.03 57.45 57.45
2019-10-14 31.31 0 31.31 31.31
2019-10-30 -1223.84 1260.7 36.86 36.86
2020-03-04 135.12 0 135.12 135.12
2020-04-16 -1132.02 1257.43 125.41 125.41
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $309.98
The current status of the model is: Holding a position since 2020-04-16 00:00:00
Processing portfolio for model: SMA_011_SlowMA_30_FastMA_05
BOUGHT QTY: 1 on 2019-01-08 00:00:00 at the price of 1086.0
SOLD QTY: -1 on 2019-05-06 00:00:00 at the price of 1172.0
BOUGHT QTY: 1 on 2019-06-25 00:00:00 at the price of 1115.08
SOLD QTY: -1 on 2019-06-26 00:00:00 at the price of 1091.0
BOUGHT QTY: 1 on 2019-07-05 00:00:00 at the price of 1119.37
SOLD QTY: -1 on 2019-08-27 00:00:00 at the price of 1183.0
BOUGHT QTY: 1 on 2019-09-06 00:00:00 at the price of 1209.14
SOLD QTY: -1 on 2019-10-04 00:00:00 at the price of 1194.29
BOUGHT QTY: 1 on 2019-10-17 00:00:00 at the price of 1251.4
SOLD QTY: -1 on 2020-02-26 00:00:00 at the price of 1394.98
BOUGHT QTY: 1 on 2020-04-14 00:00:00 at the price of 1239.97
SOLD QTY: -1 on 2020-06-30 00:00:00 at the price of 1396.88
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-08 1 1 1086 0 0
2019-05-06 -1 0 0 1172 86
2019-06-25 1 1 1115.08 0 0
2019-06-26 -1 0 0 1091 -24.08
2019-07-05 1 1 1119.37 0 0
2019-08-27 -1 0 0 1183 63.63
2019-09-06 1 1 1209.14 0 0
2019-10-04 -1 0 0 1194.29 -14.85
2019-10-17 1 1 1251.4 0 0
2020-02-26 -1 0 0 1394.98 143.58
2020-04-14 1 1 1239.97 0 0
2020-06-30 -1 0 0 1396.88 156.91
cash_onhand position_value total_position accumu_return
date
2019-01-08 -1086 1085.37 -0.63 -0.63
2019-05-06 86 0 86 86
2019-06-25 -1029.08 1087.58 58.5 58.5
2019-06-26 61.92 0 61.92 61.92
2019-07-05 -1057.45 1132.66 75.21 75.21
2019-08-27 125.55 0 125.55 125.55
2019-09-06 -1083.59 1206.32 122.73 122.73
2019-10-04 110.7 0 110.7 110.7
2019-10-17 -1140.7 1252.8 112.1 112.1
2020-02-26 254.28 0 254.28 254.28
2020-04-14 -985.69 1265.23 279.54 279.54
2020-06-30 411.19 0 411.19 411.19
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $411.19
The current status of the model is: Waiting to enter since 2020-06-30 00:00:00
Processing portfolio for model: SMA_012_SlowMA_30_FastMA_10
BOUGHT QTY: 1 on 2019-01-10 00:00:00 at the price of 1074.94
SOLD QTY: -1 on 2019-05-09 00:00:00 at the price of 1162.6
BOUGHT QTY: 1 on 2019-07-03 00:00:00 at the price of 1118.5
SOLD QTY: -1 on 2019-08-28 00:00:00 at the price of 1164.87
BOUGHT QTY: 1 on 2019-09-11 00:00:00 at the price of 1203.89
SOLD QTY: -1 on 2019-10-10 00:00:00 at the price of 1198.6
BOUGHT QTY: 1 on 2019-10-21 00:00:00 at the price of 1248.7
SOLD QTY: -1 on 2020-02-28 00:00:00 at the price of 1274.31
BOUGHT QTY: 1 on 2020-04-16 00:00:00 at the price of 1267.14
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-10 1 1 1074.94 0 0
2019-05-09 -1 0 0 1162.6 87.66
2019-07-03 1 1 1118.5 0 0
2019-08-28 -1 0 0 1164.87 46.37
2019-09-11 1 1 1203.89 0 0
2019-10-10 -1 0 0 1198.6 -5.29
2019-10-21 1 1 1248.7 0 0
2020-02-28 -1 0 0 1274.31 25.61
2020-04-16 1 1 1267.14 0 0
cash_onhand position_value total_position accumu_return
date
2019-01-10 -1074.94 1078.83 3.89 3.89
2019-05-09 87.66 0 87.66 87.66
2019-07-03 -1030.84 1122.99 92.15 92.15
2019-08-28 134.03 0 134.03 134.03
2019-09-11 -1069.86 1220 150.14 150.14
2019-10-10 128.74 0 128.74 128.74
2019-10-21 -1119.96 1244.28 124.32 124.32
2020-02-28 154.35 0 154.35 154.35
2020-04-16 -1112.79 1257.43 144.64 144.64
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $329.21
The current status of the model is: Holding a position since 2020-04-16 00:00:00
Processing portfolio for model: SMA_013_SlowMA_30_FastMA_15
BOUGHT QTY: 1 on 2019-01-16 00:00:00 at the price of 1090.0
SOLD QTY: -1 on 2019-05-14 00:00:00 at the price of 1142.32
BOUGHT QTY: 1 on 2019-07-05 00:00:00 at the price of 1119.37
SOLD QTY: -1 on 2019-08-30 00:00:00 at the price of 1200.35
BOUGHT QTY: 1 on 2019-09-12 00:00:00 at the price of 1223.47
SOLD QTY: -1 on 2019-10-14 00:00:00 at the price of 1213.89
BOUGHT QTY: 1 on 2019-10-25 00:00:00 at the price of 1252.0
SOLD QTY: -1 on 2020-03-03 00:00:00 at the price of 1397.68
BOUGHT QTY: 1 on 2020-04-17 00:00:00 at the price of 1281.7
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-16 1 1 1090 0 0
2019-05-14 -1 0 0 1142.32 52.32
2019-07-05 1 1 1119.37 0 0
2019-08-30 -1 0 0 1200.35 80.98
2019-09-12 1 1 1223.47 0 0
2019-10-14 -1 0 0 1213.89 -9.58
2019-10-25 1 1 1252 0 0
2020-03-03 -1 0 0 1397.68 145.68
2020-04-17 1 1 1281.7 0 0
cash_onhand position_value total_position accumu_return
date
2019-01-16 -1090 1089.51 -0.49 -0.49
2019-05-14 52.32 0 52.32 52.32
2019-07-05 -1067.05 1132.66 65.61 65.61
2019-08-30 133.3 0 133.3 133.3
2019-09-12 -1090.17 1234.97 144.8 144.8
2019-10-14 123.72 0 123.72 123.72
2019-10-25 -1128.28 1264.3 136.02 136.02
2020-03-03 269.4 0 269.4 269.4
2020-04-17 -1012.3 1279 266.7 266.7
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $429.70
The current status of the model is: Holding a position since 2020-04-17 00:00:00
Processing portfolio for model: SMA_014_SlowMA_30_FastMA_20
BOUGHT QTY: 1 on 2019-01-22 00:00:00 at the price of 1096.0
SOLD QTY: -1 on 2019-05-15 00:00:00 at the price of 1122.55
BOUGHT QTY: 1 on 2019-07-08 00:00:00 at the price of 1125.87
SOLD QTY: -1 on 2019-08-30 00:00:00 at the price of 1200.35
BOUGHT QTY: 1 on 2019-09-13 00:00:00 at the price of 1232.11
SOLD QTY: -1 on 2019-10-17 00:00:00 at the price of 1251.4
BOUGHT QTY: 1 on 2019-10-30 00:00:00 at the price of 1255.15
SOLD QTY: -1 on 2020-03-02 00:00:00 at the price of 1351.39
BOUGHT QTY: 1 on 2020-04-21 00:00:00 at the price of 1242.71
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-22 1 1 1096 0 0
2019-05-15 -1 0 0 1122.55 26.55
2019-07-08 1 1 1125.87 0 0
2019-08-30 -1 0 0 1200.35 74.48
2019-09-13 1 1 1232.11 0 0
2019-10-17 -1 0 0 1251.4 19.29
2019-10-30 1 1 1255.15 0 0
2020-03-02 -1 0 0 1351.39 96.24
2020-04-21 1 1 1242.71 0 0
cash_onhand position_value total_position accumu_return
date
2019-01-22 -1096 1078.63 -17.37 -17.37
2019-05-15 26.55 0 26.55 26.55
2019-07-08 -1099.32 1116.79 17.47 17.47
2019-08-30 101.03 0 101.03 101.03
2019-09-13 -1131.08 1240.03 108.95 108.95
2019-10-17 120.32 0 120.32 120.32
2019-10-30 -1134.83 1260.7 125.87 125.87
2020-03-02 216.56 0 216.56 216.56
2020-04-21 -1026.15 1212.16 186.01 186.01
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $415.85
The current status of the model is: Holding a position since 2020-04-21 00:00:00
Processing portfolio for model: SMA_015_SlowMA_35_FastMA_05
BOUGHT QTY: 1 on 2019-01-08 00:00:00 at the price of 1086.0
SOLD QTY: -1 on 2019-05-06 00:00:00 at the price of 1172.0
BOUGHT QTY: 1 on 2019-07-08 00:00:00 at the price of 1125.87
SOLD QTY: -1 on 2019-08-29 00:00:00 at the price of 1186.42
BOUGHT QTY: 1 on 2019-09-03 00:00:00 at the price of 1181.85
SOLD QTY: -1 on 2019-10-04 00:00:00 at the price of 1194.29
BOUGHT QTY: 1 on 2019-10-16 00:00:00 at the price of 1241.81
SOLD QTY: -1 on 2020-02-27 00:00:00 at the price of 1359.14
BOUGHT QTY: 1 on 2020-04-15 00:00:00 at the price of 1246.51
SOLD QTY: -1 on 2020-07-01 00:00:00 at the price of 1419.17
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-08 1 1 1086 0 0
2019-05-06 -1 0 0 1172 86
2019-07-08 1 1 1125.87 0 0
2019-08-29 -1 0 0 1186.42 60.55
2019-09-03 1 1 1181.85 0 0
2019-10-04 -1 0 0 1194.29 12.44
2019-10-16 1 1 1241.81 0 0
2020-02-27 -1 0 0 1359.14 117.33
2020-04-15 1 1 1246.51 0 0
2020-07-01 -1 0 0 1419.17 172.66
cash_onhand position_value total_position accumu_return
date
2019-01-08 -1086 1085.37 -0.63 -0.63
2019-05-06 86 0 86 86
2019-07-08 -1039.87 1116.79 76.92 76.92
2019-08-29 146.55 0 146.55 146.55
2019-09-03 -1035.3 1169.55 134.25 134.25
2019-10-04 158.99 0 158.99 158.99
2019-10-16 -1082.82 1243 160.18 160.18
2020-02-27 276.32 0 276.32 276.32
2020-04-15 -970.19 1257.3 287.11 287.11
2020-07-01 448.98 0 448.98 448.98
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $448.98
The current status of the model is: Waiting to enter since 2020-07-01 00:00:00
Processing portfolio for model: SMA_016_SlowMA_35_FastMA_10
BOUGHT QTY: 1 on 2019-01-10 00:00:00 at the price of 1074.94
SOLD QTY: -1 on 2019-05-09 00:00:00 at the price of 1162.6
BOUGHT QTY: 1 on 2019-07-10 00:00:00 at the price of 1132.32
SOLD QTY: -1 on 2019-09-05 00:00:00 at the price of 1193.66
BOUGHT QTY: 1 on 2019-09-10 00:00:00 at the price of 1196.09
SOLD QTY: -1 on 2019-10-11 00:00:00 at the price of 1224.03
BOUGHT QTY: 1 on 2019-10-18 00:00:00 at the price of 1254.69
SOLD QTY: -1 on 2020-02-28 00:00:00 at the price of 1274.31
BOUGHT QTY: 1 on 2020-04-17 00:00:00 at the price of 1281.7
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-10 1 1 1074.94 0 0
2019-05-09 -1 0 0 1162.6 87.66
2019-07-10 1 1 1132.32 0 0
2019-09-05 -1 0 0 1193.66 61.34
2019-09-10 1 1 1196.09 0 0
2019-10-11 -1 0 0 1224.03 27.94
2019-10-18 1 1 1254.69 0 0
2020-02-28 -1 0 0 1274.31 19.62
2020-04-17 1 1 1281.7 0 0
cash_onhand position_value total_position accumu_return
date
2019-01-10 -1074.94 1078.83 3.89 3.89
2019-05-09 87.66 0 87.66 87.66
2019-07-10 -1044.66 1140.91 96.25 96.25
2019-09-05 149 0 149 149
2019-09-10 -1047.09 1205.7 158.61 158.61
2019-10-11 176.94 0 176.94 176.94
2019-10-18 -1077.75 1244.41 166.66 166.66
2020-02-28 196.56 0 196.56 196.56
2020-04-17 -1085.14 1279 193.86 193.86
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $356.86
The current status of the model is: Holding a position since 2020-04-17 00:00:00
Processing portfolio for model: SMA_017_SlowMA_35_FastMA_15
BOUGHT QTY: 1 on 2019-01-17 00:00:00 at the price of 1087.99
SOLD QTY: -1 on 2019-05-14 00:00:00 at the price of 1142.32
BOUGHT QTY: 1 on 2019-07-09 00:00:00 at the price of 1110.32
SOLD QTY: -1 on 2019-09-05 00:00:00 at the price of 1193.66
BOUGHT QTY: 1 on 2019-09-06 00:00:00 at the price of 1209.14
SOLD QTY: -1 on 2019-09-11 00:00:00 at the price of 1203.89
BOUGHT QTY: 1 on 2019-09-12 00:00:00 at the price of 1223.47
SOLD QTY: -1 on 2019-10-17 00:00:00 at the price of 1251.4
BOUGHT QTY: 1 on 2019-10-24 00:00:00 at the price of 1259.11
SOLD QTY: -1 on 2020-03-03 00:00:00 at the price of 1397.68
BOUGHT QTY: 1 on 2020-04-21 00:00:00 at the price of 1242.71
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-17 1 1 1087.99 0 0
2019-05-14 -1 0 0 1142.32 54.33
2019-07-09 1 1 1110.32 0 0
2019-09-05 -1 0 0 1193.66 83.34
2019-09-06 1 1 1209.14 0 0
2019-09-11 -1 0 0 1203.89 -5.25
2019-09-12 1 1 1223.47 0 0
2019-10-17 -1 0 0 1251.4 27.93
2019-10-24 1 1 1259.11 0 0
2020-03-03 -1 0 0 1397.68 138.57
2020-04-21 1 1 1242.71 0 0
cash_onhand position_value total_position accumu_return
date
2019-01-17 -1087.99 1099.12 11.13 11.13
2019-05-14 54.33 0 54.33 54.33
2019-07-09 -1055.99 1124.29 68.3 68.3
2019-09-05 137.67 0 137.67 137.67
2019-09-06 -1071.47 1206.32 134.85 134.85
2019-09-11 132.42 0 132.42 132.42
2019-09-12 -1091.05 1234.97 143.92 143.92
2019-10-17 160.35 0 160.35 160.35
2019-10-24 -1098.76 1259.11 160.35 160.35
2020-03-03 298.92 0 298.92 298.92
2020-04-21 -943.79 1212.16 268.37 268.37
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $498.21
The current status of the model is: Holding a position since 2020-04-21 00:00:00
Processing portfolio for model: SMA_018_SlowMA_35_FastMA_20
BOUGHT QTY: 1 on 2019-01-24 00:00:00 at the price of 1082.51
SOLD QTY: -1 on 2019-05-17 00:00:00 at the price of 1175.83
BOUGHT QTY: 1 on 2019-07-11 00:00:00 at the price of 1146.16
SOLD QTY: -1 on 2019-09-10 00:00:00 at the price of 1196.09
BOUGHT QTY: 1 on 2019-09-17 00:00:00 at the price of 1231.63
SOLD QTY: -1 on 2019-10-24 00:00:00 at the price of 1259.11
BOUGHT QTY: 1 on 2019-10-30 00:00:00 at the price of 1255.15
SOLD QTY: -1 on 2020-03-04 00:00:00 at the price of 1358.96
BOUGHT QTY: 1 on 2020-04-23 00:00:00 at the price of 1265.74
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-24 1 1 1082.51 0 0
2019-05-17 -1 0 0 1175.83 93.32
2019-07-11 1 1 1146.16 0 0
2019-09-10 -1 0 0 1196.09 49.93
2019-09-17 1 1 1231.63 0 0
2019-10-24 -1 0 0 1259.11 27.48
2019-10-30 1 1 1255.15 0 0
2020-03-04 -1 0 0 1358.96 103.81
2020-04-23 1 1 1265.74 0 0
cash_onhand position_value total_position accumu_return
date
2019-01-24 -1082.51 1084 1.49 1.49
2019-05-17 93.32 0 93.32 93.32
2019-07-11 -1052.84 1144.08 91.24 91.24
2019-09-10 143.25 0 143.25 143.25
2019-09-17 -1088.38 1229.88 141.5 141.5
2019-10-24 170.73 0 170.73 170.73
2019-10-30 -1084.42 1260.7 176.28 176.28
2020-03-04 274.54 0 274.54 274.54
2020-04-23 -991.2 1271.17 279.97 279.97
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $450.80
The current status of the model is: Holding a position since 2020-04-23 00:00:00
Processing portfolio for model: SMA_019_SlowMA_40_FastMA_05
BOUGHT QTY: 1 on 2019-01-09 00:00:00 at the price of 1087.99
SOLD QTY: -1 on 2019-05-06 00:00:00 at the price of 1172.0
BOUGHT QTY: 1 on 2019-07-09 00:00:00 at the price of 1110.32
SOLD QTY: -1 on 2019-10-07 00:00:00 at the price of 1207.0
BOUGHT QTY: 1 on 2019-10-15 00:00:00 at the price of 1221.5
SOLD QTY: -1 on 2020-02-27 00:00:00 at the price of 1359.14
BOUGHT QTY: 1 on 2020-04-17 00:00:00 at the price of 1281.7
SOLD QTY: -1 on 2020-07-01 00:00:00 at the price of 1419.17
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-09 1 1 1087.99 0 0
2019-05-06 -1 0 0 1172 84.01
2019-07-09 1 1 1110.32 0 0
2019-10-07 -1 0 0 1207 96.68
2019-10-15 1 1 1221.5 0 0
2020-02-27 -1 0 0 1359.14 137.64
2020-04-17 1 1 1281.7 0 0
2020-07-01 -1 0 0 1419.17 137.47
cash_onhand position_value total_position accumu_return
date
2019-01-09 -1087.99 1081.65 -6.34 -6.34
2019-05-06 84.01 0 84.01 84.01
2019-07-09 -1026.31 1124.29 97.98 97.98
2019-10-07 180.69 0 180.69 180.69
2019-10-15 -1040.81 1242.24 201.43 201.43
2020-02-27 318.33 0 318.33 318.33
2020-04-17 -963.37 1279 315.63 315.63
2020-07-01 455.8 0 455.8 455.8
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $455.80
The current status of the model is: Waiting to enter since 2020-07-01 00:00:00
Processing portfolio for model: SMA_020_SlowMA_40_FastMA_10
BOUGHT QTY: 1 on 2019-01-10 00:00:00 at the price of 1074.94
SOLD QTY: -1 on 2019-05-09 00:00:00 at the price of 1162.6
BOUGHT QTY: 1 on 2019-07-12 00:00:00 at the price of 1142.93
SOLD QTY: -1 on 2019-10-11 00:00:00 at the price of 1224.03
BOUGHT QTY: 1 on 2019-10-17 00:00:00 at the price of 1251.4
SOLD QTY: -1 on 2020-03-02 00:00:00 at the price of 1351.39
BOUGHT QTY: 1 on 2020-04-21 00:00:00 at the price of 1242.71
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-10 1 1 1074.94 0 0
2019-05-09 -1 0 0 1162.6 87.66
2019-07-12 1 1 1142.93 0 0
2019-10-11 -1 0 0 1224.03 81.1
2019-10-17 1 1 1251.4 0 0
2020-03-02 -1 0 0 1351.39 99.99
2020-04-21 1 1 1242.71 0 0
cash_onhand position_value total_position accumu_return
date
2019-01-10 -1074.94 1078.83 3.89 3.89
2019-05-09 87.66 0 87.66 87.66
2019-07-12 -1055.27 1145.34 90.07 90.07
2019-10-11 168.76 0 168.76 168.76
2019-10-17 -1082.64 1252.8 170.16 170.16
2020-03-02 268.75 0 268.75 268.75
2020-04-21 -973.96 1212.16 238.2 238.2
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $468.04
The current status of the model is: Holding a position since 2020-04-21 00:00:00
Processing portfolio for model: SMA_021_SlowMA_40_FastMA_15
BOUGHT QTY: 1 on 2019-01-16 00:00:00 at the price of 1090.0
SOLD QTY: -1 on 2019-05-14 00:00:00 at the price of 1142.32
BOUGHT QTY: 1 on 2019-07-12 00:00:00 at the price of 1142.93
SOLD QTY: -1 on 2020-03-04 00:00:00 at the price of 1358.96
BOUGHT QTY: 1 on 2020-04-23 00:00:00 at the price of 1265.74
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-16 1 1 1090 0 0
2019-05-14 -1 0 0 1142.32 52.32
2019-07-12 1 1 1142.93 0 0
2020-03-04 -1 0 0 1358.96 216.03
2020-04-23 1 1 1265.74 0 0
cash_onhand position_value total_position accumu_return
date
2019-01-16 -1090 1089.51 -0.49 -0.49
2019-05-14 52.32 0 52.32 52.32
2019-07-12 -1090.61 1145.34 54.73 54.73
2020-03-04 268.35 0 268.35 268.35
2020-04-23 -997.39 1271.17 273.78 273.78
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $444.61
The current status of the model is: Holding a position since 2020-04-23 00:00:00
Processing portfolio for model: SMA_022_SlowMA_40_FastMA_20
BOUGHT QTY: 1 on 2019-01-23 00:00:00 at the price of 1086.86
SOLD QTY: -1 on 2019-05-17 00:00:00 at the price of 1175.83
BOUGHT QTY: 1 on 2019-07-15 00:00:00 at the price of 1145.34
SOLD QTY: -1 on 2020-03-06 00:00:00 at the price of 1269.95
BOUGHT QTY: 1 on 2020-04-27 00:00:00 at the price of 1292.0
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-23 1 1 1086.86 0 0
2019-05-17 -1 0 0 1175.83 88.97
2019-07-15 1 1 1145.34 0 0
2020-03-06 -1 0 0 1269.95 124.61
2020-04-27 1 1 1292 0 0
cash_onhand position_value total_position accumu_return
date
2019-01-23 -1086.86 1084.41 -2.45 -2.45
2019-05-17 88.97 0 88.97 88.97
2019-07-15 -1056.37 1150.51 94.14 94.14
2020-03-06 213.58 0 213.58 213.58
2020-04-27 -1078.42 1270.86 192.44 192.44
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $363.58
The current status of the model is: Holding a position since 2020-04-27 00:00:00
Processing portfolio for model: SMA_023_SlowMA_45_FastMA_05
BOUGHT QTY: 1 on 2019-01-09 00:00:00 at the price of 1087.99
SOLD QTY: -1 on 2019-05-06 00:00:00 at the price of 1172.0
BOUGHT QTY: 1 on 2019-07-10 00:00:00 at the price of 1132.32
SOLD QTY: -1 on 2019-10-08 00:00:00 at the price of 1198.77
BOUGHT QTY: 1 on 2019-10-11 00:00:00 at the price of 1224.03
SOLD QTY: -1 on 2020-02-28 00:00:00 at the price of 1274.31
BOUGHT QTY: 1 on 2020-04-20 00:00:00 at the price of 1269.89
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-09 1 1 1087.99 0 0
2019-05-06 -1 0 0 1172 84.01
2019-07-10 1 1 1132.32 0 0
2019-10-08 -1 0 0 1198.77 66.45
2019-10-11 1 1 1224.03 0 0
2020-02-28 -1 0 0 1274.31 50.28
2020-04-20 1 1 1269.89 0 0
cash_onhand position_value total_position accumu_return
date
2019-01-09 -1087.99 1081.65 -6.34 -6.34
2019-05-06 84.01 0 84.01 84.01
2019-07-10 -1048.31 1140.91 92.6 92.6
2019-10-08 150.46 0 150.46 150.46
2019-10-11 -1073.57 1215.71 142.14 142.14
2020-02-28 200.74 0 200.74 200.74
2020-04-20 -1069.15 1261.15 192 192
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $372.85
The current status of the model is: Holding a position since 2020-04-20 00:00:00
Processing portfolio for model: SMA_024_SlowMA_45_FastMA_10
BOUGHT QTY: 1 on 2019-01-10 00:00:00 at the price of 1074.94
SOLD QTY: -1 on 2019-05-10 00:00:00 at the price of 1168.84
BOUGHT QTY: 1 on 2019-07-12 00:00:00 at the price of 1142.93
SOLD QTY: -1 on 2019-10-15 00:00:00 at the price of 1221.5
BOUGHT QTY: 1 on 2019-10-16 00:00:00 at the price of 1241.81
SOLD QTY: -1 on 2020-03-03 00:00:00 at the price of 1397.68
BOUGHT QTY: 1 on 2020-04-23 00:00:00 at the price of 1265.74
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-10 1 1 1074.94 0 0
2019-05-10 -1 0 0 1168.84 93.9
2019-07-12 1 1 1142.93 0 0
2019-10-15 -1 0 0 1221.5 78.57
2019-10-16 1 1 1241.81 0 0
2020-03-03 -1 0 0 1397.68 155.87
2020-04-23 1 1 1265.74 0 0
cash_onhand position_value total_position accumu_return
date
2019-01-10 -1074.94 1078.83 3.89 3.89
2019-05-10 93.9 0 93.9 93.9
2019-07-12 -1049.03 1145.34 96.31 96.31
2019-10-15 172.47 0 172.47 172.47
2019-10-16 -1069.34 1243 173.66 173.66
2020-03-03 328.34 0 328.34 328.34
2020-04-23 -937.4 1271.17 333.77 333.77
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $504.60
The current status of the model is: Holding a position since 2020-04-23 00:00:00
Processing portfolio for model: SMA_025_SlowMA_45_FastMA_15
BOUGHT QTY: 1 on 2019-01-17 00:00:00 at the price of 1087.99
SOLD QTY: -1 on 2019-05-15 00:00:00 at the price of 1122.55
BOUGHT QTY: 1 on 2019-07-16 00:00:00 at the price of 1146.73
SOLD QTY: -1 on 2020-03-05 00:00:00 at the price of 1345.55
BOUGHT QTY: 1 on 2020-04-27 00:00:00 at the price of 1292.0
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-17 1 1 1087.99 0 0
2019-05-15 -1 0 0 1122.55 34.56
2019-07-16 1 1 1146.73 0 0
2020-03-05 -1 0 0 1345.55 198.82
2020-04-27 1 1 1292 0 0
cash_onhand position_value total_position accumu_return
date
2019-01-17 -1087.99 1099.12 11.13 11.13
2019-05-15 34.56 0 34.56 34.56
2019-07-16 -1112.17 1153.46 41.29 41.29
2020-03-05 233.38 0 233.38 233.38
2020-04-27 -1058.62 1270.86 212.24 212.24
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $383.38
The current status of the model is: Holding a position since 2020-04-27 00:00:00
Processing portfolio for model: SMA_026_SlowMA_45_FastMA_20
BOUGHT QTY: 1 on 2019-01-23 00:00:00 at the price of 1086.86
SOLD QTY: -1 on 2019-05-17 00:00:00 at the price of 1175.83
BOUGHT QTY: 1 on 2019-07-17 00:00:00 at the price of 1150.92
SOLD QTY: -1 on 2020-03-09 00:00:00 at the price of 1204.96
BOUGHT QTY: 1 on 2020-04-29 00:00:00 at the price of 1345.0
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-23 1 1 1086.86 0 0
2019-05-17 -1 0 0 1175.83 88.97
2019-07-17 1 1 1150.92 0 0
2020-03-09 -1 0 0 1204.96 54.04
2020-04-29 1 1 1345 0 0
cash_onhand position_value total_position accumu_return
date
2019-01-23 -1086.86 1084.41 -2.45 -2.45
2019-05-17 88.97 0 88.97 88.97
2019-07-17 -1061.95 1146.74 84.79 84.79
2020-03-09 143.01 0 143.01 143.01
2020-04-29 -1201.99 1342.18 140.19 140.19
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $240.01
The current status of the model is: Holding a position since 2020-04-29 00:00:00
Processing portfolio for model: SMA_027_SlowMA_50_FastMA_05
BOUGHT QTY: 1 on 2019-01-09 00:00:00 at the price of 1087.99
SOLD QTY: -1 on 2019-05-07 00:00:00 at the price of 1185.81
BOUGHT QTY: 1 on 2019-07-11 00:00:00 at the price of 1146.16
SOLD QTY: -1 on 2019-10-07 00:00:00 at the price of 1207.0
BOUGHT QTY: 1 on 2019-10-11 00:00:00 at the price of 1224.03
SOLD QTY: -1 on 2020-02-28 00:00:00 at the price of 1274.31
BOUGHT QTY: 1 on 2020-04-27 00:00:00 at the price of 1292.0
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-09 1 1 1087.99 0 0
2019-05-07 -1 0 0 1185.81 97.82
2019-07-11 1 1 1146.16 0 0
2019-10-07 -1 0 0 1207 60.84
2019-10-11 1 1 1224.03 0 0
2020-02-28 -1 0 0 1274.31 50.28
2020-04-27 1 1 1292 0 0
cash_onhand position_value total_position accumu_return
date
2019-01-09 -1087.99 1081.65 -6.34 -6.34
2019-05-07 97.82 0 97.82 97.82
2019-07-11 -1048.34 1144.08 95.74 95.74
2019-10-07 158.66 0 158.66 158.66
2019-10-11 -1065.37 1215.71 150.34 150.34
2020-02-28 208.94 0 208.94 208.94
2020-04-27 -1083.06 1270.86 187.8 187.8
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $358.94
The current status of the model is: Holding a position since 2020-04-27 00:00:00
Processing portfolio for model: SMA_028_SlowMA_50_FastMA_10
BOUGHT QTY: 1 on 2019-01-10 00:00:00 at the price of 1074.94
SOLD QTY: -1 on 2019-05-10 00:00:00 at the price of 1168.84
BOUGHT QTY: 1 on 2019-07-15 00:00:00 at the price of 1145.34
SOLD QTY: -1 on 2020-03-03 00:00:00 at the price of 1397.68
BOUGHT QTY: 1 on 2020-04-27 00:00:00 at the price of 1292.0
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-10 1 1 1074.94 0 0
2019-05-10 -1 0 0 1168.84 93.9
2019-07-15 1 1 1145.34 0 0
2020-03-03 -1 0 0 1397.68 252.34
2020-04-27 1 1 1292 0 0
cash_onhand position_value total_position accumu_return
date
2019-01-10 -1074.94 1078.83 3.89 3.89
2019-05-10 93.9 0 93.9 93.9
2019-07-15 -1051.44 1150.51 99.07 99.07
2020-03-03 346.24 0 346.24 346.24
2020-04-27 -945.76 1270.86 325.1 325.1
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $496.24
The current status of the model is: Holding a position since 2020-04-27 00:00:00
Processing portfolio for model: SMA_029_SlowMA_50_FastMA_15
BOUGHT QTY: 1 on 2019-01-17 00:00:00 at the price of 1087.99
SOLD QTY: -1 on 2019-05-15 00:00:00 at the price of 1122.55
BOUGHT QTY: 1 on 2019-07-18 00:00:00 at the price of 1142.0
SOLD QTY: -1 on 2020-03-06 00:00:00 at the price of 1269.95
BOUGHT QTY: 1 on 2020-04-29 00:00:00 at the price of 1345.0
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-17 1 1 1087.99 0 0
2019-05-15 -1 0 0 1122.55 34.56
2019-07-18 1 1 1142 0 0
2020-03-06 -1 0 0 1269.95 127.95
2020-04-29 1 1 1345 0 0
cash_onhand position_value total_position accumu_return
date
2019-01-17 -1087.99 1099.12 11.13 11.13
2019-05-15 34.56 0 34.56 34.56
2019-07-18 -1107.44 1147.24 39.8 39.8
2020-03-06 162.51 0 162.51 162.51
2020-04-29 -1182.49 1342.18 159.69 159.69
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $259.51
The current status of the model is: Holding a position since 2020-04-29 00:00:00
Processing portfolio for model: SMA_030_SlowMA_50_FastMA_20
BOUGHT QTY: 1 on 2019-01-24 00:00:00 at the price of 1082.51
SOLD QTY: -1 on 2019-05-20 00:00:00 at the price of 1153.0
BOUGHT QTY: 1 on 2019-07-19 00:00:00 at the price of 1149.32
SOLD QTY: -1 on 2020-03-10 00:00:00 at the price of 1254.39
BOUGHT QTY: 1 on 2020-05-01 00:00:00 at the price of 1324.09
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-24 1 1 1082.51 0 0
2019-05-20 -1 0 0 1153 70.49
2019-07-19 1 1 1149.32 0 0
2020-03-10 -1 0 0 1254.39 105.07
2020-05-01 1 1 1324.09 0 0
cash_onhand position_value total_position accumu_return
date
2019-01-24 -1082.51 1084 1.49 1.49
2019-05-20 70.49 0 70.49 70.49
2019-07-19 -1078.83 1131.55 52.72 52.72
2020-03-10 175.56 0 175.56 175.56
2020-05-01 -1148.53 1317.32 168.79 168.79
Accumulated profit/loss for one share of stock with initial capital of $0 at the end of modeling period: $293.47
The current status of the model is: Holding a position since 2020-05-01 00:00:00
# Display the model performance summary
performance_summary.sort_values(by=['return_value'], inplace=True, ascending=False)
print(performance_summary)
model_name return_value return_percent 23 SMA_024_SlowMA_45_FastMA_10 504.60 None 16 SMA_017_SlowMA_35_FastMA_15 498.21 None 27 SMA_028_SlowMA_50_FastMA_10 496.24 None 19 SMA_020_SlowMA_40_FastMA_10 468.04 None 18 SMA_019_SlowMA_40_FastMA_05 455.80 None 17 SMA_018_SlowMA_35_FastMA_20 450.80 None 14 SMA_015_SlowMA_35_FastMA_05 448.98 None 20 SMA_021_SlowMA_40_FastMA_15 444.61 None 12 SMA_013_SlowMA_30_FastMA_15 429.70 None 13 SMA_014_SlowMA_30_FastMA_20 415.85 None 2 SMA_003_SlowMA_15_FastMA_10 411.30 None 10 SMA_011_SlowMA_30_FastMA_05 411.19 None 8 SMA_009_SlowMA_25_FastMA_15 400.19 None 5 SMA_006_SlowMA_20_FastMA_15 395.53 None 7 SMA_008_SlowMA_25_FastMA_10 394.47 None 24 SMA_025_SlowMA_45_FastMA_15 383.38 None 1 SMA_002_SlowMA_15_FastMA_05 375.25 None 22 SMA_023_SlowMA_45_FastMA_05 372.85 None 6 SMA_007_SlowMA_25_FastMA_05 369.95 None 21 SMA_022_SlowMA_40_FastMA_20 363.58 None 26 SMA_027_SlowMA_50_FastMA_05 358.94 None 15 SMA_016_SlowMA_35_FastMA_10 356.86 None 11 SMA_012_SlowMA_30_FastMA_10 329.21 None 9 SMA_010_SlowMA_25_FastMA_20 309.98 None 3 SMA_004_SlowMA_20_FastMA_05 309.71 None 29 SMA_030_SlowMA_50_FastMA_20 293.47 None 28 SMA_029_SlowMA_50_FastMA_15 259.51 None 25 SMA_026_SlowMA_45_FastMA_20 240.01 None 4 SMA_005_SlowMA_20_FastMA_10 219.44 None 0 SMA_001_SlowMA_10_FastMA_05 162.04 None
# Display the transactions from the top model
top_model = performance_summary.iloc[0]['model_name']
print('The transactions from the top model %s:' % (top_model))
print(portfolio_collection[top_model][portfolio_collection[top_model].trade_action != 0])
The transactions from the top model SMA_024_SlowMA_45_FastMA_10:
trade_action qty_onhand cost_basis sold_transaction gain_loss \
date
2019-01-10 1 1 1074.94 0 0
2019-05-10 -1 0 0 1168.84 93.9
2019-07-12 1 1 1142.93 0 0
2019-10-15 -1 0 0 1221.5 78.57
2019-10-16 1 1 1241.81 0 0
2020-03-03 -1 0 0 1397.68 155.87
2020-04-23 1 1 1265.74 0 0
cash_onhand position_value total_position accumu_return
date
2019-01-10 -1074.94 1078.83 3.89 3.89
2019-05-10 93.9 0 93.9 93.9
2019-07-12 -1049.03 1145.34 96.31 96.31
2019-10-15 172.47 0 172.47 172.47
2019-10-16 -1069.34 1243 173.66 173.66
2020-03-03 328.34 0 328.34 328.34
2020-04-23 -937.4 1271.17 333.77 333.77
# Display the entry and exit signals for the top model
print('The trading signal changes from the top model %s:' % (top_model))
print(model_collection[top_model][model_collection[top_model].signal_change != 0])
The trading signal changes from the top model SMA_024_SlowMA_45_FastMA_10:
open_price close_price fast_ma slow_ma ma_change \
date
2019-01-09 1087.99 1081.65 1059.355 1058.187111 1.167889
2019-05-09 1162.60 1167.97 1201.303 1207.458222 -6.155222
2019-07-11 1146.16 1144.08 1115.375 1114.955556 0.419444
2019-10-14 1213.89 1217.77 1202.804 1203.569111 -0.765111
2019-10-15 1221.50 1242.24 1206.428 1205.074444 1.353556
2020-03-02 1351.39 1386.32 1428.193 1438.586667 -10.393667
2020-04-22 1241.11 1258.41 1241.466 1234.256889 7.209111
trade_signal signal_change entry_exit
date
2019-01-09 1.0 1.0 0.0
2019-05-09 0.0 -1.0 0.0
2019-07-11 1.0 1.0 0.0
2019-10-14 0.0 -1.0 0.0
2019-10-15 1.0 1.0 -1.0
2020-03-02 0.0 -1.0 0.0
2020-04-22 1.0 1.0 0.0
graph_data = model_collection[top_model].copy()
title_string = "Simple Moving Average Crossover Model for " + top_model
fig = plt.figure(figsize=(16,9))
ylabel = stock_symbol + ' price in $'
ax1 = fig.add_subplot(111, ylabel=ylabel, title=title_string)
graph_data['fast_ma'].plot(ax=ax1, color='b', lw=2.)
graph_data['slow_ma'].plot(ax=ax1, color='r', lw=2.)
graph_data['close_price'].plot(ax=ax1, color='g')
ax1.plot(graph_data.loc[graph_data.entry_exit == 1].index, graph_data.close_price[graph_data.entry_exit == 1], '^', markersize=7, color='k',label='buy')
ax1.plot(graph_data.loc[graph_data.entry_exit == -1].index, graph_data.close_price[graph_data.entry_exit == -1], 'v', markersize=7, color='k',label='sell')
plt.legend(loc='upper left')
plt.show()
best_model = ''
best_return = 0
for key in portfolio_collection:
if portfolio_collection[key]['accumu_return'][-1] > best_return:
best_model = key
best_return = portfolio_collection[best_model]['accumu_return'][-1]
print('The best model found is:', best_model)
print('The best profit/loss for the investing period is: $%.2f' % (best_return))
if initial_capital != 0:
print('The best return percentage for initial capital is: %.2f%%' % (best_return / initial_capital * 100))
The best model found is: SMA_024_SlowMA_45_FastMA_10 The best profit/loss for the investing period is: $504.60
worst_model = None
worst_return = 0
for key in portfolio_collection:
if portfolio_collection[key]['accumu_return'][-1] < worst_return:
worst_model = key
worst_return = portfolio_collection[worst_model]['accumu_return'][-1]
print('The worst model found is:', worst_model)
print('The worst profit/loss for the investing period is: $%.2f' % (worst_return))
if initial_capital != 0:
print('The worst return percentage for the initial capital is: %.2f%%' % (worst_return / initial_capital * 100))
The worst model found is: None The worst profit/loss for the investing period is: $0.00
# Calculate the stock's performance for a long-only model
model_template = model_template[model_start_date:model_end_date]
print('The performance of the long-only model from day one is: $%.2f' %(model_template.iloc[-1]['close_price'] - model_template.iloc[0]['open_price']))
The performance of the long-only model from day one is: $414.80
print ('Total time for the script:',(datetime.now() - startTimeScript))
Total time for the script: 0:01:42.063087